diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/bindings/scripts/scripts/npc/npcs_special.cpp | 49 | ||||
-rw-r--r-- | src/game/Creature.h | 1 | ||||
-rw-r--r-- | src/game/Player.cpp | 3 |
3 files changed, 52 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(); } diff --git a/src/game/Creature.h b/src/game/Creature.h index 61cb390b02f..d291aaf9db0 100644 --- a/src/game/Creature.h +++ b/src/game/Creature.h @@ -150,6 +150,7 @@ enum CreatureFlagsExtra CREATURE_FLAG_EXTRA_WORLDEVENT = 0x00004000, // custom flag for world event creatures (left room for merging) //CREATURE_FLAG_EXTRA_CHARM_AI = 0x00008000, // use ai when charmed CREATURE_FLAG_EXTRA_NO_CRIT = 0x00020000, // creature can't do critical strikes + CREATURE_FLAG_EXTRA_NO_SKILLGAIN = 0x00040000, // creature won't increase weapon skills }; enum SummonMask diff --git a/src/game/Player.cpp b/src/game/Player.cpp index 6e92e7d4b6a..0b75d090152 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -5288,6 +5288,9 @@ void Player::UpdateWeaponSkill (WeaponAttackType attType) if(m_form == FORM_TREE) return; // use weapon but not skill up + if(pVictim && pVictim->GetTypeId() == TYPEID_UNIT && (((Creature*)pVictim)->GetCreatureInfo()->flags_extra & CREATURE_FLAG_EXTRA_NO_SKILLGAIN)) + return; + uint32 weapon_skill_gain = sWorld.getConfig(CONFIG_SKILL_GAIN_WEAPON); switch(attType) |