View Single Post
  #1  
Old 10-14-2008, 04:04 PM
seveianrex
Sarnak
 
Join Date: Sep 2008
Location: asdf
Posts: 60
Default Pet Power Item Focus

The following snippet provides the implementation for pet power item focus. The focus has been setup to provide a prescribed percentage increase, which should scale with level nicely.

Code has been pre-tested locally for bugs.

{Zone\spdat.h}
find (line ~241)
Code:
#define SE_PetPowerIncrease			167	//not implemented, base % increase of pet stuff
and replace comment
Code:
#define SE_PetPowerIncrease			167	//percentage boost to pet HP, min/max damage, min/max HP
{Zone\client.h}
find (line ~88)
Code:
typedef enum {	//focus types
	focusSpellHaste = 1,
	focusSpellDuration,
	focusRange,
	focusReagentCost,
	focusManaCost,
	focusImprovedHeal,
	focusImprovedDamage,
	focusImprovedDOT,		//i dont know about this...
	focusImprovedCritical,
	focusImprovedUndeadDamage
and add a new item to the enum
Code:
focusPetPower
{Zone\spell_effects.cpp}

find (line ~3269)
Code:
case SE_ReduceManaCost:
			if (type == focusManaCost && focus_spell.base[i] > value)
			{
				value = focus_spell.base[i];
			}
			break;
and add:
Code:
case SE_PetPowerIncrease:
			if (type == focusPetPower && focus_spell.base[i] > value)
			{
				value = focus_spell.base[i];
			}
			break;
{Zone\pets.cpp}

in void MakePet, around line 190, find the following:

Code:
memcpy(npc_type, base, sizeof(NPCType));
and add below:

Code:
	// focus effects only apply for client casters
	// the pet is either focused or not, the value on the item is irrelevant
	if (this->IsClient() && CastToClient()->GetFocusEffect(focusPetPower, spell_id) > 0)
	{
		npc_type->max_hp *= 1.20;
		npc_type->cur_hp = npc_type->max_hp;
		npc_type->AC *= 1.20;
		npc_type->level += 1;
		npc_type->min_dmg *= 1.10;
		npc_type->max_dmg *= 1.10;
	}
Reply With Quote