Thread: Random fixes
View Single Post
  #33  
Old 08-28-2004, 06:49 AM
Branks
Sarnak
 
Join Date: May 2004
Posts: 58
Default

dont use old manaburn or lifeburn code, remove them and use the new stuff posted below, this will allow the buff from manaburn to take hold and not allow manaburn groups however the buff stacking system doesnt seem to work with it currently- also this method allows pvp checks and you dont have to modify the spell value.

also updated the previous code for zone/spells.cpp to include a few more things and updated it since i learned a little more of the way spells are handled. case SE_CurrentHP that is.

added code to place a cap on pvp damage of 70% for a single spell like live used to be, if you want it 40% like live is currently youll have to do it yourself.

added cleric fury and fury of magic mastery, im not too sure of the exact values of these AAs so i just guessed that its a little behind the other versions.

also added quick damage, quick evacuation and spell casting deftness. i think theres another spell haste AA but cant think of it currently. will update whenever i do

also swarm pets are still killing exsisting pets and i have yet to find a way around this but im working on it.

zone/spells.cpp right below case SE_CurrentHP youll find
case: SE_CurrentHPOnce- replace exsisting with this-

Code:
			case SE_CurrentHPOnce:	// used in buffs usually, see Courage
			{
#ifdef SPELL_EFFECT_SPAM
				snprintf(effect_desc, _EDLEN, "Current Hitpoints Once: %+i", effect_value);
#endif
				//Dook- added manaburn, lifeburn
				if(spell_id==2751)
				{
					int r=MakeRandomInt(0,10);
					if(r>=9)
					{
						effect_value+=((caster->GetMana())*2.4)*-1;
						caster->SetMana(0);
						entity_list.MessageClose(caster,false,75,0,"%s delivers a critical blast! (%d)",caster->GetName(),((effect_value)*(-1)));
						caster->Message(0,"You deliver a critical blast! (%d)", ((effect_value)*(-1)));
					}
					else
					{
						effect_value+=((caster->GetMana())*1.8)*-1;
						caster->SetMana(0);
					}
				}
				if(spell_id==2755)
				{
					effect_value+=(caster->GetHP())*-1;
					caster->SetHP(caster->CalcMaxHP()/4);
				}
				ChangeHP(caster, effect_value, spell_id, buffslot);
				break;
			}
then in zone/attack.cpp do a search for "cut all pvp" and alter the exsisting code to be-

Code:
	if (amount < 0)
	{
		// cut all PVP spell damage to 2/3 -solar
		if(other && this->IsClient() && other->IsClient() && this != other)
			amount = (int) (amount * 0.67f);
		//Dook- Added 70% single blow max damage	--pvp dmg cap
		if(other && this->IsClient() && other->IsClient())
		{
			int pcmaxdmg=(((this->CalcMaxHP())*0.7)*(-1));
			if(amount<pcmaxdmg)
				amount=pcmaxdmg;
		}
		this->Damage(other, abs(amount), spell_id, 231, false, buffslot, iBuffTic);
		return true;
	}
then in zone/spells.capp again do a search for "we know our" and alter exsisting code to look like this-

Code:
	// we know our mana cost now
	casting_spell_mana = mana_cost;

	//Dook- Casting Haste
	if((IsClient)&&(spell_id != 13)&&(slot != 9)&&(slot != 10)&&(cast_time >= 4000))
	{
		int dur=spells[spell_id].buffduration;
		int dmg;
		for (int i = 0; i < EFFECT_COUNT; i++)
		{
			if (spells[spell_id].effectid[i] == SE_CurrentHP)
			{
				dmg = CalcSpellEffectValue(spell_id, i, GetCasterLevel());
				break;
			}   
		}
		Client *c=this->CastToClient();
		if(IsEffectInSpell(spell_id, SE_Succor))	//Dook- Quick Evac
		{
			uint8 qe=c->GetAA(42);
			if(qe==1){cast_time=(cast_time*0.90);}
			if(qe==2){cast_time=(cast_time*0.75);}
			if(qe==3){cast_time=(cast_time*0.50);}
		}
		if((IsEffectInSpell(spell_id,SE_CurrentHPOnce))||
			(IsEffectInSpell(spell_id,SE_CurrentHP))&&(dmg<=0))
		{
			uint8 qd=c->GetAA(44);
			if(qd==1){cast_time=(cast_time*0.98);}
			if(qd==2){cast_time=(cast_time*0.95);}
			if(qd==3){cast_time=(cast_time*0.90);}
		}
		if(IsBeneficialSpell(spell_id)&&(dur > 0))
		{
			uint8 deft=c->GetAA(27);
			if(deft==1){cast_time=(cast_time*0.95);}
			if(deft==2){cast_time=(cast_time*0.85);}
			if(deft==3){cast_time=(cast_time*0.75);}
		}
		else if(cast_time <= 0)
		{
			cast_time = 0;
		}
	}

	orgcasttime = cast_time;

	// cast time is 0, just finish it right now and be done with it
	if(cast_time == 0)
thats all for now.
Reply With Quote