Core/Entities: correct creature damage, offhand damage should work too

* todo: some creatures need dmg_multiplier update in creature_template
This commit is contained in:
joschiwald committed 2014-01-04 18:22:06 +01:00
1 parent ff61e4d79d
commit cd76d32907
22 files changed
+337 -310

No files matched your search

+15 -25
View File
@@ -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();
}