diff options
-rw-r--r-- | sql/FULL/world_scripts_full.sql | 4 | ||||
-rw-r--r-- | sql/FULL/world_tmp_full.sql | 1 | ||||
-rw-r--r-- | sql/updates/4544_world.sql | 3 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/item/item_scripts.cpp | 22 | ||||
-rw-r--r-- | src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp | 115 | ||||
-rw-r--r-- | src/game/Unit.cpp | 2 |
6 files changed, 145 insertions, 2 deletions
diff --git a/sql/FULL/world_scripts_full.sql b/sql/FULL/world_scripts_full.sql index c4cdeab90a7..fbbbf44c77f 100644 --- a/sql/FULL/world_scripts_full.sql +++ b/sql/FULL/world_scripts_full.sql @@ -81,6 +81,7 @@ UPDATE `item_template` SET `ScriptName`='item_yehkinyas_bramble' WHERE `entry`=1 UPDATE `item_template` SET `ScriptName`='item_zezzaks_shard' WHERE `entry`=31463; UPDATE `item_template` SET `ScriptName`='item_only_for_flight' WHERE `entry` IN (34475, 34489, 24538); UPDATE `item_template` SET `ScriptName`='item_inoculating_crystal' WHERE `entry`=22962; +UPDATE `item_template` SET `ScriptName`='item_incendiary_explosives' WHERE (`entry`=35704); /* NPC (usually creatures to be found in more than one specific zone) */ UPDATE `creature_template` SET `ScriptName`='npc_air_force_bots' WHERE `entry` IN (2614, 2615, 21974, 21993, 21996, 21997, 21999, 22001, 22002, 22003, 22063, 22065, 22066, 22068, 22069, 22070, 22071, 22078, 22079, 22080, 22086, 22087, 22088, 22090, 22124, 22125, 22126); @@ -115,6 +116,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_dkc1_gothik' WHERE `entry`=2865 UPDATE `creature_template` SET `ScriptName`='npc_a_special_surprise' WHERE `entry` IN (29032, 29061, 29065, 29067, 29068, 29070, 29074, 29072, 29073, 29071); 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; /* */ /* ZONE */ @@ -309,6 +311,7 @@ UPDATE `creature_template` SET `ScriptName`='npc_captured_sunhawk_agent' WHERE ` /* BOREAN TUNDRA */ UPDATE `creature_template` SET `ScriptName`='npc_surristrasz' WHERE `entry`=24795; UPDATE `creature_template` SET `ScriptName`='npc_tiare' WHERE `entry`=30051; +UPDATE `creature_template` SET `ScriptName`='npc_sinkhole_kill_credit' WHERE `entry` IN (26248,26249); /* BURNING STEPPES */ UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563; @@ -1092,7 +1095,6 @@ UPDATE `creature_template` SET `ScriptName`='mob_spawn_of_marli' WHERE `entry`=1 UPDATE `creature_template` SET `ScriptName`='mob_batrider' WHERE `entry`=14965; UPDATE `creature_template` SET `ScriptName`='mob_shade_of_jindo' WHERE `entry`=14986; UPDATE `creature_template` SET `ScriptName`='mob_ohgan' WHERE `entry`=14988; -UPDATE `creature_template` SET `ScriptName`='npc_mirror_image' WHERE `entry`=31216; UPDATE `creature_template` SET `ScriptName`='EventAI', `modelid_A` = 16925,`modelid_H` = 16925, `minmana` = 1000000,`maxmana` = 1000000, `unit_flags` = 33554434 WHERE `entry` IN(29998, 33753, 33752, 33751, 33750); DELETE FROM `creature_ai_scripts` WHERE `creature_id` IN (29998, 33753, 33752, 33751, 33750); diff --git a/sql/FULL/world_tmp_full.sql b/sql/FULL/world_tmp_full.sql index 9931dc50ee3..8b9e65d3f65 100644 --- a/sql/FULL/world_tmp_full.sql +++ b/sql/FULL/world_tmp_full.sql @@ -179,6 +179,7 @@ spell6 = VALUES(spell6), spell7 = VALUES(spell7), spell8 = VALUES(spell8); +UPDATE `creature_template` SET `flags_extra`=2 WHERE (`entry`=26250); # Plug the Sinkholes - worm UPDATE `creature_template` SET `spell1`=59638, `spell2` = 59637 WHERE `entry`=31216; # Mirror Image # Spore diff --git a/sql/updates/4544_world.sql b/sql/updates/4544_world.sql new file mode 100644 index 00000000000..90f7e193f15 --- /dev/null +++ b/sql/updates/4544_world.sql @@ -0,0 +1,3 @@ +UPDATE `creature_template` SET `ScriptName`='npc_sinkhole_kill_credit' WHERE (`entry`='26248') or (`entry`='26249'); +UPDATE `item_template` SET `ScriptName`='item_incendiary_explosives' WHERE (`entry`='35704'); +UPDATE `creature_template` SET `flags_extra`='2' WHERE (`entry`='26250'); diff --git a/src/bindings/scripts/scripts/item/item_scripts.cpp b/src/bindings/scripts/scripts/item/item_scripts.cpp index f577d0fed9c..d30efdae89f 100644 --- a/src/bindings/scripts/scripts/item/item_scripts.cpp +++ b/src/bindings/scripts/scripts/item/item_scripts.cpp @@ -489,6 +489,23 @@ bool ItemUse_item_zezzak_shard(Player *player, Item* _Item, SpellCastTargets con return true; } +/*##### +# item_incendiary_explosives +#####*/ + +bool ItemUse_item_incendiary_explosives(Player *player, Item* _Item, SpellCastTargets const& targets) +{ + if ( player->FindNearestCreature(26248,15) || player->FindNearestCreature(26249,15) ) + { + return false; + } + else + { + player->SendEquipError(EQUIP_ERR_OUT_OF_RANGE,_Item,NULL); + return true; + } +} + void AddSC_item_scripts() { Script *newscript; @@ -592,5 +609,10 @@ void AddSC_item_scripts() newscript->Name="item_zezzaks_shard"; newscript->pItemUse = &ItemUse_item_zezzak_shard; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="item_incendiary_explosives"; + newscript->pItemUse = &ItemUse_item_incendiary_explosives; + newscript->RegisterSelf(); } diff --git a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp index 94c93c8e449..c45ef53a81a 100644 --- a/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp +++ b/src/bindings/scripts/scripts/zone/borean_tundra/borean_tundra.cpp @@ -87,6 +87,116 @@ bool GossipSelect_npc_surristrasz(Player *player, Creature *_Creature, uint32 se return true; } +/*###### +## npc_sinkhole_kill_credit +######*/ + +enum +{ + SPELL_SET_CART = 46797, + SPELL_EXPLODE_CART = 46799, + SPELL_SUMMON_CART = 46798, + SPELL_SUMMON_WORM = 46800, +}; + +struct TRINITY_DLL_DECL npc_sinkhole_kill_creditAI : public ScriptedAI +{ + npc_sinkhole_kill_creditAI(Creature* c) : ScriptedAI(c){} + + uint32 Phase_Timer; + uint8 Phase; + Unit* Caster; + + void Reset() + { + Phase_Timer = 500; + Phase = 0; + Caster = NULL; + } + + void SpellHit(Unit *caster, const SpellEntry *spell) + { + if (Phase) + return; + + if (spell->Id == SPELL_SET_CART && CAST_PLR(caster)->GetQuestStatus(11897) == QUEST_STATUS_INCOMPLETE) + { + Phase = 1; + Caster = caster; + } + } + + void EnterCombat(Unit* who) { } + + void UpdateAI(const uint32 diff) + { + if (!Phase) + return; + + if (Phase_Timer < diff) + { + switch (Phase) + { + case 1: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + DoCast(m_creature, SPELL_SUMMON_CART, true); + if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) + cart->SetUInt32Value(GAMEOBJECT_FACTION, 14); + Phase_Timer = 3000; + Phase = 2; + break; + case 2: + if (GameObject* cart = m_creature->FindNearestGameObject(188160,3)) + cart->UseDoorOrButton(); + DoCast(m_creature, SPELL_EXPLODE_CART, true); + Phase_Timer = 3000; + Phase = 3; + break; + case 3: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + Phase_Timer = 2000; + Phase = 4; + case 5: + DoCast(m_creature, SPELL_SUMMON_WORM, true); + if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) + { + worm->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE); + worm->HandleEmoteCommand(EMOTE_ONESHOT_EMERGE); + } + Phase_Timer = 1000; + Phase = 6; + break; + case 6: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + if (Unit* worm = m_creature->FindNearestCreature(26250, 3)) + { + m_creature->DealDamage(worm, worm->GetHealth()); + worm->RemoveFlag(UNIT_DYNAMIC_FLAGS, UNIT_DYNFLAG_LOOTABLE); + } + Phase_Timer = 2000; + Phase = 7; + break; + case 7: + DoCast(m_creature, SPELL_EXPLODE_CART, true); + CAST_PLR(Caster)->KilledMonster(m_creature->GetCreatureInfo(),m_creature->GetGUID()); + Phase_Timer = 5000; + Phase = 8; + break; + case 8: + EnterEvadeMode(); + break; + } + } else Phase_Timer -= diff; + + } + +}; + +CreatureAI* GetAI_npc_sinkhole_kill_credit(Creature* pCreature) +{ + return new npc_sinkhole_kill_creditAI(pCreature); +} + void AddSC_borean_tundra() { Script *newscript; @@ -102,4 +212,9 @@ void AddSC_borean_tundra() newscript->pGossipHello = &GossipHello_npc_surristrasz; newscript->pGossipSelect = &GossipSelect_npc_surristrasz; newscript->RegisterSelf(); + + newscript = new Script; + newscript->Name="npc_sinkhole_kill_credit"; + newscript->GetAI = &GetAI_npc_sinkhole_kill_credit; + newscript->RegisterSelf(); } diff --git a/src/game/Unit.cpp b/src/game/Unit.cpp index 308d510e5ae..882a599466e 100644 --- a/src/game/Unit.cpp +++ b/src/game/Unit.cpp @@ -1412,7 +1412,7 @@ void Unit::CalculateMeleeDamage(Unit *pVictim, uint32 damage, CalcDamageInfo *da damageInfo->procEx = PROC_EX_NONE; damageInfo->hitOutCome = MELEE_HIT_EVADE; - if(!this || !pVictim) + if(!pVictim) return; if(!this->isAlive() || !pVictim->isAlive()) return; |