diff options
| author | Rat <none@none> | 2009-08-04 12:38:35 +0200 |
|---|---|---|
| committer | Rat <none@none> | 2009-08-04 12:38:35 +0200 |
| commit | 35cf6778de1ff4e9c4b38e311bcb1552693c6e2c (patch) | |
| tree | b67213867560db31bf5c5c268772fb2372cb3670 /src/bindings | |
| parent | 73ce3bd36636a891cbf1e714b63e73a9f21fdc81 (diff) | |
*added script for training dummies
*added new creature extra flag (CREATURE_FLAG_EXTRA_NO_SKILLGAIN) if set creature won't increase player's weapon skill
--HG--
branch : trunk
Diffstat (limited to 'src/bindings')
| -rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 49 |
1 files changed, 48 insertions, 1 deletions
diff --git a/src/bindings/scripts/scripts/npc/npcs_special.cpp b/src/bindings/scripts/scripts/npc/npcs_special.cpp index 2c0bcd51918..8dbdc6d09cf 100644 --- a/src/bindings/scripts/scripts/npc/npcs_special.cpp +++ b/src/bindings/scripts/scripts/npc/npcs_special.cpp @@ -1626,7 +1626,7 @@ struct TRINITY_DLL_DECL mob_mojoAI : public ScriptedAI victimGUID = player->GetGUID(); m_creature->CastSpell(m_creature,20372,true);//tag.hearts m_creature->GetMotionMaster()->MoveFollow(player,0,0); - hearts = 15000; + hearts = 15000; } } }; @@ -1699,6 +1699,48 @@ CreatureAI* GetAI_npc_mirror_image(Creature *_Creature) return new npc_mirror_image (_Creature); } +struct TRINITY_DLL_DECL npc_training_dummy : Scripted_NoMovementAI +{ + npc_training_dummy(Creature *c) : Scripted_NoMovementAI(c) {} + + uint32 ResetTimer; + void Reset() + { + m_creature->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate + m_creature->ApplySpellImmune(0, IMMUNITY_EFFECT, SPELL_EFFECT_KNOCK_BACK, true);//imune to knock aways like blast wave + m_creature->ApplySpellImmune(0, IMMUNITY_MECHANIC, MECHANIC_STUN, true); + ResetTimer = 10000; + } + + void DamageTaken(Unit *done_by, uint32 &damage) + { + ResetTimer = 10000; + damage = 0; + } + + void EnterCombat(Unit *who){return;} + + void UpdateAI(const uint32 diff) + { + if(!UpdateVictim()) + return; + if(!m_creature->hasUnitState(UNIT_STAT_STUNNED)) + m_creature->SetControlled(true,UNIT_STAT_STUNNED);//disable rotate + if(ResetTimer <= diff) + { + EnterEvadeMode(); + ResetTimer = 10000; + }else ResetTimer -= diff; + return; + } + void MoveInLineOfSight(Unit *who){return;} +}; + +CreatureAI* GetAI_npc_training_dummy(Creature *_Creature) +{ + return new npc_training_dummy (_Creature); +} + void AddSC_npcs_special() { Script *newscript; @@ -1799,5 +1841,10 @@ void AddSC_npcs_special() newscript->Name="mob_mojo"; newscript->GetAI = &GetAI_mob_mojo; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_training_dummy"; + newscript->GetAI = &GetAI_npc_training_dummy; + newscript->RegisterSelf(); } |
