Skip to content

Commit 57789e4

Browse files
author
nofantasy
committed
Making one quest become not so bloody imp-ossible, using new AI call OwnerKilledUnit
git-svn-id: http://scriptdev2.svn.sourceforge.net/svnroot/scriptdev2@1888 5f9c896b-1e26-0410-94da-f77f675e2462
1 parent 48ae61c commit 57789e4

File tree

6 files changed

+54
-3
lines changed

6 files changed

+54
-3
lines changed

scripts/outland/netherstorm.cpp

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
/* ScriptData
1818
SDName: Netherstorm
1919
SD%Complete: 80
20-
SDComment: Quest support: 10438, 10652 (special flight paths), 10299, 10321, 10322, 10323, 10329, 10330, 10337, 10338, 10365(Shutting Down Manaforge), 10198, 10191
20+
SDComment: Quest support: 10438, 10652 (special flight paths), 10299, 10321, 10322, 10323, 10329, 10330, 10337, 10338, 10365(Shutting Down Manaforge), 10198, 10191, 10924
2121
SDCategory: Netherstorm
2222
EndScriptData */
2323

@@ -33,6 +33,7 @@ EndContentData */
3333

3434
#include "precompiled.h"
3535
#include "escort_ai.h"
36+
#include "pet_ai.h"
3637

3738
/*######
3839
## npc_manaforge_control_console
@@ -919,6 +920,42 @@ bool QuestAccept_npc_maxx_a_million(Player* pPlayer, Creature* pCreature, const
919920
return true;
920921
}
921922

923+
/*######
924+
## npc_zeppit
925+
######*/
926+
927+
enum
928+
{
929+
EMOTE_GATHER_BLOOD = -1000625,
930+
NPC_WARP_CHASER = 18884,
931+
SPELL_GATHER_WARP_BLOOD = 39244, // for quest 10924
932+
};
933+
934+
struct MANGOS_DLL_DECL npc_zeppitAI : public ScriptedPetAI
935+
{
936+
npc_zeppitAI(Creature* pCreature) : ScriptedPetAI(pCreature) { Reset(); }
937+
938+
void Reset() { }
939+
940+
void OwnerKilledUnit(Unit* pVictim)
941+
{
942+
if (pVictim->GetTypeId() == TYPEID_UNIT && pVictim->GetEntry() == NPC_WARP_CHASER)
943+
{
944+
// Distance not known, be assumed to be ~10 yards, possibly a bit less.
945+
if (m_creature->IsWithinDistInMap(pVictim, 10.0f))
946+
{
947+
DoScriptText(EMOTE_GATHER_BLOOD, m_creature);
948+
m_creature->CastSpell(m_creature, SPELL_GATHER_WARP_BLOOD, false);
949+
}
950+
}
951+
}
952+
};
953+
954+
CreatureAI* GetAI_npc_zeppit(Creature* pCreature)
955+
{
956+
return new npc_zeppitAI(pCreature);
957+
}
958+
922959
void AddSC_netherstorm()
923960
{
924961
Script* pNewScript;
@@ -966,4 +1003,9 @@ void AddSC_netherstorm()
9661003
pNewScript->GetAI = &GetAI_npc_maxx_a_million;
9671004
pNewScript->pQuestAccept = &QuestAccept_npc_maxx_a_million;
9681005
pNewScript->RegisterSelf();
1006+
1007+
pNewScript = new Script;
1008+
pNewScript->Name = "npc_zeppit";
1009+
pNewScript->GetAI = &GetAI_npc_zeppit;
1010+
pNewScript->RegisterSelf();
9691011
}

sql/Updates/Makefile.am

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,5 +194,7 @@ pkgdata_DATA = \
194194
r1878_mangos.sql \
195195
r1881_mangos.sql \
196196
r1882_scriptdev2.sql \
197-
r1886_scriptdev2.sql
197+
r1886_scriptdev2.sql \
198+
r1888_mangos.sql \
199+
r1888_scriptdev2.sql
198200

sql/Updates/r1888_mangos.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
UPDATE creature_template SET ScriptName='npc_zeppit' WHERE entry=22484;

sql/Updates/r1888_scriptdev2.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
DELETE FROM script_texts WHERE entry=-1000625;
2+
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
3+
(-1000625,'%s gathers the warp chaser\'s blood.',0,2,0,0,'zeppit EMOTE_GATHER_BLOOD');

sql/mangos_scriptname_full.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -821,6 +821,7 @@ UPDATE creature_template SET ScriptName='npc_protectorate_nether_drake' WHERE en
821821
UPDATE creature_template SET ScriptName='npc_veronia' WHERE entry=20162;
822822
UPDATE creature_template SET ScriptName='npc_bessy' WHERE entry=20415;
823823
UPDATE creature_template SET ScriptName='npc_maxx_a_million' WHERE entry=19589;
824+
UPDATE creature_template SET ScriptName='npc_zeppit' WHERE entry=22484;
824825

825826
/* */
826827
/* THE NEXUS */

sql/scriptdev2_script_full.sql

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -663,7 +663,9 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
663663
(-1000621,'All systems on-line. Prepare yourself, we leave shortly.',0,0,0,0,'maxx SAY_START'),
664664
(-1000622,'Be careful in there and come back in one piece!',0,0,0,0,'maxx SAY_ALLEY_FAREWELL'),
665665
(-1000623,'Proceed.',0,0,0,0,'maxx SAY_CONTINUE'),
666-
(-1000624,'You\'re back! Were you able to get all of the machines?',0,0,0,0,'maxx SAY_ALLEY_FINISH');
666+
(-1000624,'You\'re back! Were you able to get all of the machines?',0,0,0,0,'maxx SAY_ALLEY_FINISH'),
667+
668+
(-1000625,'%s gathers the warp chaser\'s blood.',0,2,0,0,'zeppit EMOTE_GATHER_BLOOD');
667669

668670
-- -1 033 000 SHADOWFANG KEEP
669671
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES

0 commit comments

Comments
 (0)