Skip to content

Commit

Permalink
[3153] Quest support for DK quest 13188 and 13189
Browse files Browse the repository at this point in the history
Thanks to @Grz3s for providing the information

Close unified-db/Database#76
  • Loading branch information
xfurry committed Aug 16, 2015
1 parent 161da42 commit 42c495f
Show file tree
Hide file tree
Showing 6 changed files with 97 additions and 6 deletions.
67 changes: 66 additions & 1 deletion scripts/world/guards.cpp
Expand Up @@ -17,7 +17,7 @@
/* ScriptData
SDName: Guards
SD%Complete: 100
SDComment: CombatAI should be organized better for future.
SDComment: CombatAI should be organized better for future. Quest support 13188 / 13189.
SDCategory: Guards
EndScriptData */

Expand Down Expand Up @@ -271,6 +271,69 @@ CreatureAI* GetAI_guard_undercity(Creature* pCreature)
return new guardAI(pCreature);
}

/*******************************************************
* quests 13188 / 13189
*******************************************************/

enum
{
SPELL_RETURN_ORGRIMMAR = 58552,
SPELL_RETURN_STORMWIND = 58533,

SPELL_TOSS_APPLE = 58509,
SPELL_TOSS_BANANA = 58513,
SPELL_SPIT = 58520,

EMOTE_APPLE = -1609081,
EMOTE_BANANA = -1609082,
EMOTE_SPIT = -1609083,
SAY_RANDOM_1 = -1609084,
SAY_RANDOM_2 = -1609085,
SAY_RANDOM_3 = -1609086,
SAY_RANDOM_4 = -1609087,
SAY_RANDOM_5 = -1609088,
SAY_RANDOM_6 = -1609287,
SAY_RANDOM_7 = -1609288,
SAY_RANDOM_8 = -1609289,
};

bool EffectDummyCreature_npc_city_guard(Unit* pCaster, uint32 uiSpellId, SpellEffectIndex uiEffIndex, Creature* pCreatureTarget, ObjectGuid /*originalCasterGuid*/)
{
// check spell ids; creature ids are defined in script target
if ((uiSpellId == SPELL_RETURN_ORGRIMMAR || uiSpellId == SPELL_RETURN_STORMWIND) && uiEffIndex == EFFECT_INDEX_0)
{
// random action
switch (urand(0, 10))
{
case 0:
pCreatureTarget->CastSpell(pCaster, SPELL_TOSS_APPLE, true);
DoScriptText(EMOTE_APPLE, pCreatureTarget, pCaster);
break;
case 1:
pCreatureTarget->CastSpell(pCaster, SPELL_TOSS_BANANA, true);
DoScriptText(EMOTE_BANANA, pCreatureTarget, pCaster);
break;
case 2:
pCreatureTarget->CastSpell(pCaster, SPELL_SPIT, true);
DoScriptText(EMOTE_SPIT, pCreatureTarget, pCaster);
break;
case 3: DoScriptText(SAY_RANDOM_1, pCreatureTarget, pCaster); break;
case 4: DoScriptText(SAY_RANDOM_2, pCreatureTarget, pCaster); break;
case 5: DoScriptText(SAY_RANDOM_3, pCreatureTarget, pCaster); break;
case 6: DoScriptText(SAY_RANDOM_4, pCreatureTarget, pCaster); break;
case 7: DoScriptText(SAY_RANDOM_5, pCreatureTarget, pCaster); break;
case 8: DoScriptText(SAY_RANDOM_6, pCreatureTarget, pCaster); break;
case 9: DoScriptText(SAY_RANDOM_7, pCreatureTarget, pCaster); break;
case 10: DoScriptText(SAY_RANDOM_8, pCreatureTarget, pCaster); break;
}

// return true as we don't need further script handling in DB
return true;
}

return false;
}

void AddSC_guards()
{
Script* pNewScript;
Expand Down Expand Up @@ -333,6 +396,7 @@ void AddSC_guards()
pNewScript = new Script;
pNewScript->Name = "guard_orgrimmar";
pNewScript->GetAI = &GetAI_guard_orgrimmar;
pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_city_guard;
pNewScript->RegisterSelf();

pNewScript = new Script;
Expand All @@ -358,6 +422,7 @@ void AddSC_guards()
pNewScript = new Script;
pNewScript->Name = "guard_stormwind";
pNewScript->GetAI = &GetAI_guard_stormwind;
pNewScript->pEffectDummyNPC = &EffectDummyCreature_npc_city_guard;
pNewScript->RegisterSelf();

pNewScript = new Script;
Expand Down
2 changes: 1 addition & 1 deletion sd2_revision_nr.h
@@ -1,4 +1,4 @@
#ifndef __SD2_REVISION_NR_H__
#define __SD2_REVISION_NR_H__
#define SD2_REVISION_NR "3152"
#define SD2_REVISION_NR "3153"
#endif // __SD2_REVISION_NR_H__
4 changes: 2 additions & 2 deletions sql/mangos_scriptname_full.sql
Expand Up @@ -124,8 +124,8 @@ UPDATE gameobject_template SET ScriptName='go_lab_work_reagents' WHERE entry IN

/* GUARD */
UPDATE creature_template SET ScriptName='guard_azuremyst' WHERE entry=18038;
UPDATE creature_template SET ScriptName='guard_orgrimmar' WHERE entry=3296;
UPDATE creature_template SET ScriptName='guard_stormwind' WHERE entry IN (68,1976);
UPDATE creature_template SET ScriptName='guard_orgrimmar' WHERE entry IN (3296,14304);
UPDATE creature_template SET ScriptName='guard_stormwind' WHERE entry IN (68,1756,1976);
UPDATE creature_template SET ScriptName='guard_contested' WHERE entry IN (9460,4624,3502,11190,15184);
UPDATE creature_template SET ScriptName='guard_elwynnforest' WHERE entry=1423;
UPDATE creature_template SET ScriptName='guard_eversong' WHERE entry=16221;
Expand Down
15 changes: 13 additions & 2 deletions sql/scriptdev2_script_full.sql
Expand Up @@ -4151,7 +4151,14 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1609079,'Hrm, what a strange tree. I must investigate.',0,0,0,1,'scarlet courier SAY_TREE_1'),
(-1609080,'What\'s this!? This isn\'t a tree at all! Guards! Guards!',0,0,0,5,'scarlet courier SAY_TREE_2'),

-- PLEASE RE-USE -1609081 to -1609088
(-1609081,'%s throws rotten apple on $N.',0,2,0,0,'city guard EMOTE_APPLE'),
(-1609082,'%s throws rotten banana on $N.',0,2,0,0,'city guard EMOTE_BANANA'),
(-1609083,'%s spits on $N.',0,2,0,0,'city guard EMOTE_SPIT'),
(-1609084,'Monster!',0,0,0,14,'city guard SAY_RANDOM_1'),
(-1609085,'Murderer!',0,0,0,14,'city guard SAY_RANDOM_2'),
(-1609086,'GET A ROPE!',0,0,0,25,'city guard SAY_RANDOM_3'),
(-1609087,'How dare you set foot in our city!',0,0,0,25,'city guard SAY_RANDOM_4'),
(-1609088,'You disgust me.',0,0,0,14,'city guard SAY_RANDOM_5'),

(-1609089,'The Eye of Acherus launches towards its destination',0,3,0,0,'eye of acherus EMOTE_DESTIANTION'),
(-1609090,'The Eye of Acherus is in your control',0,3,0,0,'eye of acherus EMOTE_CONTROL'),
Expand Down Expand Up @@ -4251,7 +4258,11 @@ INSERT INTO script_texts (entry,content_default,sound,type,language,emote,commen
(-1609283,'%s collapses.',0,2,0,0,'Highlord Darion Mograine'),
(-1609284,'%s charges towards the Lich King, Ashbringer in hand and strikes the Lich King.',0,2,0,0,'Highlord Tirion Fordring'),
(-1609285,'%s disappears. Tirion walks over to where Darion lay',0,2,0,0,'The Lich King'),
(-1609286,'Light washes over the chapel -- the Light of Dawn is uncovered.',0,2,0,0,'');
(-1609286,'Light washes over the chapel -- the Light of Dawn is uncovered.',0,2,0,0,''),

(-1609287,'Looks like we\'re going to have ourselves an execution.',0,0,0,25,'city guard SAY_RANDOM_6'),
(-1609288,'Traitorous dog.',0,0,0,14,'city guard SAY_RANDOM_7'),
(-1609289,'My family was wiped out by the Scourge! MONSTER!',0,0,0,25,'city guard SAY_RANDOM_8');

-- -1 615 000 OBSIDIAN SANCTUM
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
Expand Down
2 changes: 2 additions & 0 deletions sql/updates/r3153_mangos.sql
@@ -0,0 +1,2 @@
UPDATE creature_template SET ScriptName='guard_orgrimmar' WHERE entry=14304;
UPDATE creature_template SET ScriptName='guard_stormwind' WHERE entry IN (68,1756,1976);
13 changes: 13 additions & 0 deletions sql/updates/r3153_scriptdev2.sql
@@ -0,0 +1,13 @@
DELETE FROM script_texts WHERE entry IN (-1609081,-1609082,-1609083,-1609084,-1609085,-1609086,-1609087,-1609088,-1609287,-1609288,-1609289);
INSERT INTO script_texts (entry,content_default,sound,type,language,emote,comment) VALUES
(-1609081,'%s throws rotten apple on $N.',0,2,0,0,'city guard EMOTE_APPLE'),
(-1609082,'%s throws rotten banana on $N.',0,2,0,0,'city guard EMOTE_BANANA'),
(-1609083,'%s spits on $N.',0,2,0,0,'city guard EMOTE_SPIT'),
(-1609084,'Monster!',0,0,0,14,'city guard SAY_RANDOM_1'),
(-1609085,'Murderer!',0,0,0,14,'city guard SAY_RANDOM_2'),
(-1609086,'GET A ROPE!',0,0,0,25,'city guard SAY_RANDOM_3'),
(-1609087,'How dare you set foot in our city!',0,0,0,25,'city guard SAY_RANDOM_4'),
(-1609088,'You disgust me.',0,0,0,14,'city guard SAY_RANDOM_5'),
(-1609287,'Looks like we\'re going to have ourselves an execution.',0,0,0,25,'city guard SAY_RANDOM_6'),
(-1609288,'Traitorous dog.',0,0,0,14,'city guard SAY_RANDOM_7'),
(-1609289,'My family was wiped out by the Scourge! MONSTER!',0,0,0,25,'city guard SAY_RANDOM_8');

0 comments on commit 42c495f

Please sign in to comment.