*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
This commit is contained in:
@@ -121,6 +121,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_a_special_surprise' WHERE `entr
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_demolisher_engineerer' WHERE `entry` IN (30400, 30499);
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_valkyr_battle_maiden' WHERE `entry`=28534;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_mirror_image' WHERE `entry`=31216;
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_training_dummy' WHERE `entry` IN (17578, 24792, 32543, 32546, 32542, 32545, 30527, 31143, 31144, 31146, 32541, 32666, 32667);
|
||||
|
||||
/* */
|
||||
/* ZONE */
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
UPDATE `creature_template` SET `ScriptName`='npc_training_dummy', `flags_extra`='262144', `mechanic_immune_mask`='0', `faction_A`='7', `faction_H`='7' WHERE `entry` IN (17578, 24792, 32543, 32546, 32542, 32545, 30527, 31143, 31144, 31146, 32541, 32666, 32667);
|
||||
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user