aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/FULL/world_scripts_full.sql1
-rw-r--r--sql/updates/4751_world_scripts.sql1
-rw-r--r--src/bindings/scripts/scripts/npc/npcs_special.cpp49
-rw-r--r--src/game/Creature.h1
-rw-r--r--src/game/Player.cpp3
5 files changed, 54 insertions, 1 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql
index cf06c8d2b42..17272c9b98e 100644
--- a/sql/FULL/world_scripts_full.sql
+++ b/sql/FULL/world_scripts_full.sql
@@ -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 */
diff --git a/sql/updates/4751_world_scripts.sql b/sql/updates/4751_world_scripts.sql
new file mode 100644
index 00000000000..5bedf2df1c4
--- /dev/null
+++ b/sql/updates/4751_world_scripts.sql
@@ -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);
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)