diff options
| author | joschiwald <joschiwald@online.de> | 2014-01-04 18:22:06 +0100 |
|---|---|---|
| committer | joschiwald <joschiwald@online.de> | 2014-01-04 18:22:06 +0100 |
| commit | cd76d3290719161db1c10b4c82de191db1cef7e8 (patch) | |
| tree | 5f2e3c498de123817dda7488dd60a7dade0c36ce /src/server/scripts/Pet | |
| parent | ff61e4d79deeae19fe3bcbd3f8ce09b83bf7af4a (diff) | |
Core/Entities: correct creature damage, offhand damage should work too
* todo: some creatures need dmg_multiplier update in creature_template
Diffstat (limited to 'src/server/scripts/Pet')
| -rw-r--r-- | src/server/scripts/Pet/pet_hunter.cpp | 40 |
1 files changed, 15 insertions, 25 deletions
diff --git a/src/server/scripts/Pet/pet_hunter.cpp b/src/server/scripts/Pet/pet_hunter.cpp index 0db35bf2fe6..8a0b78b5478 100644 --- a/src/server/scripts/Pet/pet_hunter.cpp +++ b/src/server/scripts/Pet/pet_hunter.cpp @@ -25,9 +25,9 @@ enum HunterSpells { - SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper - SPELL_HUNTER_DEADLY_POISON = 34655, // Venomous Snake - SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper + SPELL_HUNTER_CRIPPLING_POISON = 30981, // Viper + SPELL_HUNTER_DEADLY_POISON_PASSIVE = 34657, // Venomous Snake + SPELL_HUNTER_MIND_NUMBING_POISON = 25810 // Viper }; enum HunterCreatures @@ -57,14 +57,17 @@ class npc_pet_hunter_snake_trap : public CreatureScript me->SetMaxHealth(uint32(107 * (me->getLevel() - 40) * 0.025f)); // Add delta to make them not all hit the same time uint32 delta = (rand() % 7) * 100; - me->SetStatFloatValue(UNIT_FIELD_BASEATTACKTIME, float(Info->baseattacktime + delta)); - me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower)); + me->SetAttackTime(BASE_ATTACK, Info->baseattacktime + delta); + //me->SetStatFloatValue(UNIT_FIELD_RANGED_ATTACK_POWER, float(Info->attackpower)); // Start attacking attacker of owner on first ai update after spawn - move in line of sight may choose better target if (!me->GetVictim() && me->IsSummon()) if (Unit* Owner = me->ToTempSummon()->GetSummoner()) if (Owner->getAttackerForHelper()) AttackStart(Owner->getAttackerForHelper()); + + if (!_isViper) + DoCast(me, SPELL_HUNTER_DEADLY_POISON_PASSIVE, true); } // Redefined for random target selection: @@ -99,32 +102,19 @@ class npc_pet_hunter_snake_trap : public CreatureScript return; } - if (_spellTimer <= diff) + // Viper + if (_isViper) { - if (_isViper) // Viper + if (_spellTimer <= diff) { - if (urand(0, 2) == 0) //33% chance to cast - { - uint32 spell; - if (urand(0, 1) == 0) - spell = SPELL_HUNTER_MIND_NUMBING_POISON; - else - spell = SPELL_HUNTER_CRIPPLING_POISON; - - DoCastVictim(spell); - } + if (urand(0, 2) == 0) // 33% chance to cast + DoCastVictim(RAND(SPELL_HUNTER_MIND_NUMBING_POISON, SPELL_HUNTER_CRIPPLING_POISON)); _spellTimer = 3000; } - else // Venomous Snake - { - if (urand(0, 2) == 0) // 33% chance to cast - DoCastVictim(SPELL_HUNTER_DEADLY_POISON); - _spellTimer = 1500 + (rand() % 5) * 100; - } + else + _spellTimer -= diff; } - else - _spellTimer -= diff; DoMeleeAttackIfReady(); } |
