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
+17 -7
View File
@@ -1139,16 +1139,12 @@ void Mob::AI_Process() {
}
}
if (IsPet() || (IsNPC() && CastToNPC()->GetSwarmOwner())) {
if (IsPet() || IsTempPet()) {
Mob *owner = nullptr;
if (IsPet())
owner = GetOwner();
else
owner = entity_list.GetMobID(CastToNPC()->GetSwarmOwner());
owner = GetOwner();
if (owner) {
int16 flurry_chance = owner->aabonuses.PetFlurry +
int16 flurry_chance = owner->aabonuses.PetFlurry +
owner->spellbonuses.PetFlurry + owner->itembonuses.PetFlurry;
if (flurry_chance && zone->random.Roll(flurry_chance))
@@ -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)
{
int rampage_chance = GetSpecialAbilityParam(SPECATK_RAMPAGE, 0);
@@ -1245,6 +1254,7 @@ void Mob::AI_Process() {
//now special attacks (kick, etc)
if(IsNPC())
CastToNPC()->DoClassAttacks(target);
}
AI_EngagedCastCheck();
} //end is within combat rangepet