Implemented SE_PC_Pet_Rampage 464 - Base1 % chance to do rampage for base2 % of damage each melee round

This commit is contained in:
KayenEQ 2015-09-25 04:44:17 -04:00
parent 957aba7ae5
commit a11816fddf
4 changed files with 34 additions and 9 deletions

View File

@ -617,8 +617,8 @@ typedef enum {
//#define SE_Fc_Damage_%2 461 // //#define SE_Fc_Damage_%2 461 //
//#define SE_Fc_Damage_Amt2 462 // //#define SE_Fc_Damage_Amt2 462 //
//#define SE_Shield_Target 463 // //#define SE_Shield_Target 463 //
//#define SE_PC_Pet_Rampage 464 // #define SE_PC_Pet_Rampage 464 // Base1 % chance to do rampage for base2 % of damage each melee round
//#define SE_PC_Pet_AE_Rampage 465 // #define SE_PC_Pet_AE_Rampage 465 // Base1 % chance to do aerampage for base2 % of damage each melee round
//#define SE_PC_Pet_Flurry_Chance 466 // //#define SE_PC_Pet_Flurry_Chance 466 //
//#define SE_DS_Mitigation_Amount 467 // //#define SE_DS_Mitigation_Amount 467 //
//#define SE_DS_Mitigation_Percentage 468 // //#define SE_DS_Mitigation_Percentage 468 //

View File

@ -1417,6 +1417,13 @@ void Mob::ApplyAABonuses(const AA::Rank &rank, StatBonuses *newbon)
case SE_IncreaseExtTargetWindow: case SE_IncreaseExtTargetWindow:
newbon->extra_xtargets += base1; newbon->extra_xtargets += base1;
break; break;
case SE_PC_Pet_Rampage: {
newbon->PC_Pet_Rampage[0] += base1; //Chance to rampage
if (newbon->PC_Pet_Rampage[1] < base2)
newbon->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest
break;
}
// to do // to do
case SE_PetDiscipline: case SE_PetDiscipline:
break; break;
@ -3120,6 +3127,13 @@ void Mob::ApplySpellsBonuses(uint16 spell_id, uint8 casterlevel, StatBonuses *ne
break; break;
} }
case SE_PC_Pet_Rampage: {
new_bonus->PC_Pet_Rampage[0] += effect_value; //Chance to rampage
if (new_bonus->PC_Pet_Rampage[1] < base2)
new_bonus->PC_Pet_Rampage[1] = base2; //Damage modifer - take highest
break;
}
//Special custom cases for loading effects on to NPC from 'npc_spels_effects' table //Special custom cases for loading effects on to NPC from 'npc_spels_effects' table
if (IsAISpellEffect) { if (IsAISpellEffect) {

View File

@ -405,6 +405,7 @@ struct StatBonuses {
bool LimitToSkill[HIGHEST_SKILL+2]; // Determines if we need to search for a skill proc. bool LimitToSkill[HIGHEST_SKILL+2]; // Determines if we need to search for a skill proc.
uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs. uint32 SkillProc[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs.
uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success. uint32 SkillProcSuccess[MAX_SKILL_PROCS]; // Max number of spells containing skill_procs_success.
uint32 PC_Pet_Rampage[2]; // 0= % chance to rampage, 1=damage modifier
// AAs // AAs
int8 Packrat; //weight reduction for items, 1 point = 10% int8 Packrat; //weight reduction for items, 1 point = 10%

View File

@ -1139,13 +1139,9 @@ void Mob::AI_Process() {
} }
} }
if (IsPet() || (IsNPC() && CastToNPC()->GetSwarmOwner())) { if (IsPet() || IsTempPet()) {
Mob *owner = nullptr; Mob *owner = nullptr;
if (IsPet())
owner = GetOwner(); owner = GetOwner();
else
owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner());
if (owner) { if (owner) {
int16 flurry_chance = owner->aabonuses.PetFlurry + int16 flurry_chance = owner->aabonuses.PetFlurry +
@ -1156,6 +1152,19 @@ void Mob::AI_Process() {
} }
} }
if ((IsPet() || IsTempPet()) && IsPetOwnerClient()){
if (spellbonuses.PC_Pet_Rampage[0] || itembonuses.PC_Pet_Rampage[0] || aabonuses.PC_Pet_Rampage[0]){
int chance = spellbonuses.PC_Pet_Rampage[0] + itembonuses.PC_Pet_Rampage[0] + aabonuses.PC_Pet_Rampage[0];
int dmg_mod = spellbonuses.PC_Pet_Rampage[1] + itembonuses.PC_Pet_Rampage[1] + aabonuses.PC_Pet_Rampage[1];
Shout("CHance %i", chance);
if(zone->random.Roll(chance)) {
ExtraAttackOptions opts;
opts.damage_percent = dmg_mod / 100.0f;
Rampage(&opts);
}
}
}
if (GetSpecialAbility(SPECATK_RAMPAGE) && !specialed) if (GetSpecialAbility(SPECATK_RAMPAGE) && !specialed)
{ {
int rampage_chance = GetSpecialAbilityParam(SPECATK_RAMPAGE, 0); int rampage_chance = GetSpecialAbilityParam(SPECATK_RAMPAGE, 0);
@ -1245,6 +1254,7 @@ void Mob::AI_Process() {
//now special attacks (kick, etc) //now special attacks (kick, etc)
if(IsNPC()) if(IsNPC())
CastToNPC()->DoClassAttacks(target); CastToNPC()->DoClassAttacks(target);
} }
AI_EngagedCastCheck(); AI_EngagedCastCheck();
} //end is within combat rangepet } //end is within combat rangepet