Skip to content

Commit

Permalink
Script: Add scripting for Quest A Blade Fit For A Champion
Browse files Browse the repository at this point in the history
Still need pooled spawning for entry 33224. Aokromes has info if someone wants to do it.
  • Loading branch information
malcrom committed Jun 13, 2013
1 parent 2f771d4 commit 4065a85
Show file tree
Hide file tree
Showing 2 changed files with 151 additions and 0 deletions.
15 changes: 15 additions & 0 deletions sql/updates/world/2013_06_13_00_world_misc.sql
@@ -0,0 +1,15 @@
-- Updates for Quest A Blade Fit For A Champion

UPDATE `creature_template` SET `ScriptName`= 'npc_lake_frog' WHERE `entry` IN (33211,33224);
UPDATE `creature_template` SET `npcflag`=1 WHERE `entry` IN (33224);

-- Add option conditions for gossip
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId` IN (15) AND `SourceGroup` IN (10316);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`,`SourceGroup`,`SourceEntry`,`ElseGroup`,`ConditionTypeOrReference`,`ConditionValue1`,`ConditionValue2`,`ConditionValue3`,`NegativeCondition`,`ErrorTextId`,`ScriptName`,`Comment`) VALUES
(15,10316,0,0,2,44981,1,1,1,0,'','Maiden of Ashwood Lake - Show gossip option if player does not have Ashwood Brand');

-- NPC talk text insert from sniff
DELETE FROM `creature_text` WHERE `entry`=33220;
INSERT INTO `creature_text` (`entry`,`groupid`,`id`,`text`,`type`,`language`,`probability`,`emote`,`duration`,`sound`,`comment`) VALUES
(33220,0,0, 'Can it really be? Free after all these years?',12,0,100,1,0,0, 'Maiden of Ashwood Lake'),
(33220,1,0, 'And now, I must return to the waters of the lake.',12,0,100,2,0,0, 'Maiden of Ashwood Lake');
136 changes: 136 additions & 0 deletions src/server/scripts/Northrend/zone_grizzly_hills.cpp
Expand Up @@ -692,6 +692,141 @@ class npc_venture_co_straggler : public CreatureScript
}
};

/*######
## Quest A Blade Fit For A Champion
######*/

enum eLakeFrog
{
SPELL_WARTSBGONE_LIP_BALM = 62574,
SPELL_FROG_LOVE = 62537, // for 1 minute !
SPELL_WARTS = 62581,
SPELL_MAIDEN_OF_ASHWOOD_LAKE_TRANSFORM = 62550,
SPELL_SUMMON_ASHWOOD_BRAND = 62554,
ITEM_WARTS_B_GONE_LIP_BALM = 44986,
NPC_LAKE_FROG = 33211,
NPC_LAKE_FROG_QUEST = 33224,
SAY_MAIDEN_0 = 0,
SAY_MAIDEN_1 = 1
};

class npc_lake_frog : public CreatureScript
{
public:
npc_lake_frog(): CreatureScript("npc_lake_frog") { }

struct npc_lake_frogAI : public ScriptedAI
{
npc_lake_frogAI(Creature* creature) : ScriptedAI(creature) { }

void Reset()
{
uiFollowing = false;
uiRunningScript = false;
uiPhase = 0;
if (me->GetEntry() == NPC_LAKE_FROG_QUEST)
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
}

void UpdateAI(uint32 uiDiff)
{
if (uiFollowing)
if(!me->HasAura(SPELL_FROG_LOVE))
me->DespawnOrUnsummon(0);

if (uiRunningScript)
{
if (uiScriptTimer <= uiDiff)
{
switch (uiPhase)
{
case 0:
DoCast(me, SPELL_MAIDEN_OF_ASHWOOD_LAKE_TRANSFORM);
me->SetEntry(33220);
uiScriptTimer = 2000;
++uiPhase;
break;
case 1:
Talk(SAY_MAIDEN_0);
uiScriptTimer = 3000;
++uiPhase;
break;
case 2:
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
uiScriptTimer = 25000;
++uiPhase;
break;
case 3:
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_GOSSIP);
uiScriptTimer = 2000;
++uiPhase;
break;
case 4:
Talk(SAY_MAIDEN_1);
uiScriptTimer = 4000;
++uiPhase;
break;
case 5:
uiRunningScript=false;
me->DespawnOrUnsummon(0);
break;
}
}
else if (uiScriptTimer)
uiScriptTimer -= uiDiff;
}

}

void ReceiveEmote(Player* player, uint32 emote)
{
if (uiFollowing || uiRunningScript)
return;

if(emote==TEXT_EMOTE_KISS && me->IsWithinDistInMap(player, 30.0f) && player->HasItemCount(ITEM_WARTS_B_GONE_LIP_BALM, 1, false))
{
if(!player->HasAura(SPELL_WARTSBGONE_LIP_BALM))
player->AddAura(SPELL_WARTS, player);

else
{
player->RemoveAura(SPELL_WARTSBGONE_LIP_BALM);

if (me->GetEntry() == NPC_LAKE_FROG)
{
me->AddAura(SPELL_FROG_LOVE, me);
me->GetMotionMaster()->MoveFollow(player, 0.3f, frand (M_PI/2, M_PI + (M_PI/2)));
uiFollowing=true;
}
else if (me->GetEntry() == NPC_LAKE_FROG_QUEST)
{
me->SetWalk(false);
me->SetFacingToObject(player);
uiRunningScript=true;
uiScriptTimer = 2000;
}
}
}
}

void sGossipSelect(Player* player, uint32 sender, uint32 /*action*/)
{
DoCast(player, SPELL_SUMMON_ASHWOOD_BRAND);
}

private:
bool uiFollowing;
bool uiRunningScript;
uint32 uiScriptTimer;
uint8 uiPhase;
};

CreatureAI* GetAI(Creature* creature) const
{
return new npc_lake_frogAI(creature);
}
};

void AddSC_grizzly_hills()
{
new npc_emily();
Expand All @@ -702,4 +837,5 @@ void AddSC_grizzly_hills()
new npc_wounded_skirmisher();
new npc_lightning_sentry();
new npc_venture_co_straggler();
new npc_lake_frog();
}

9 comments on commit 4065a85

@w1sht0l1v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

come on...i pasted a SAI alternative yesterday..wich does same thing..

@malcrom
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't see any SAI posted that works like this.

@filipboev
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fight!

@Kiperr-zz
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I bet on Malcrom!

@dr-j
Copy link
Contributor

@dr-j dr-j commented on 4065a85 Jun 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What exactly needs doing with pooling here, think its not just pooling that needs doing think theres also meant to be a lot more than the 15 or so frogs which are currently spawned, videos of this quest show a lot more frogs and even wowhead shows them as been all around the lake when on tc they are all just in one corner of the lake.

@malcrom
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have some more spawns to add. but they are not critical for the quest to work. Just the 33224 spawns I gave Aokromes are needed. There are 6 spawn locations but only one is spawned at a time. I gave him the spawn sql, someone just needed to do the pooling.

@dr-j
Copy link
Contributor

@dr-j dr-j commented on 4065a85 Jun 13, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well I got data from Aokromes,

This what I came up with

    -- Add missing lake frog spawns
    SET @GUID := XXXXXX;
    SET @POOL := XXXXXX;

    DELETE FROM `creature` WHERE `guid` BETWEEN @GUID AND @GUID+4;
    INSERT INTO `creature` (`guid`,`id`,`map`,`spawnMask`,`phaseMask`,`modelid`,`equipment_id`,`position_x`,`position_y`,`position_z`,`orientation`,`spawntimesecs`,`spawndist`,`currentwaypoint`,`curhealth`,`curmana`,`MovementType`) VALUES
    (@GUID+0,33224,571,1,1,0,0,3819.225,-4360.781,182.312,4.927386,120,5,0,1,0,1),
    (@GUID+1,33224,571,1,1,0,0,3822.34,-4362.166,182.5561,0.4575224,120,5,0,1,0,1),
    (@GUID+2,33224,571,1,1,0,0,3803.501,-4354.347,180.8061,4.409188,120,5,0,1,0,1),
    (@GUID+3,33224,571,1,1,0,0,3778.917,-4312.72,183.4503,0.9890772,120,5,0,1,0,1),
    (@GUID+4,33224,571,1,1,0,0,3805.652,-4352.625,181.4311,5.342484,120,5,0,1,0,1),
    (@GUID+5,33224,571,1,1,0,0,3803.122,-4347.75,180.8061,2.036006,120,5,0,1,0,1);

    DELETE FROM `pool_template` WHERE `entry`=@POOL;
    INSERT INTO `pool_template` (`entry`, `max_limit`, `description`) VALUES 
    (@POOL, 1, 'Lake Frog');

    DELETE FROM `pool_creature` WHERE `guid` BETWEEN @GUID AND @GUID+4 AND `pool_entry`=@POOL;

    INSERT INTO `pool_creature` (`guid`, `pool_entry`, `chance`, `description`) VALUES 
    (@GUID+0, @POOL, 0, 'Lake Frog (Good) - Spawn 1'),
    (@GUID+1, @POOL, 0, 'Lake Frog (Good) - Spawn 2'),
    (@GUID+2, @POOL, 0, 'Lake Frog (Good) - Spawn 3'),
    (@GUID+3, @POOL, 0, 'Lake Frog (Good) - Spawn 4'),
    (@GUID+4, @POOL, 0, 'Lake Frog (Good) - Spawn 5'),
    (@GUID+5, @POOL, 0, 'Lake Frog (Good) - Spawn 6');

@w1sht0l1v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had pasted something similar on irc yesterday(sai only).anyway...need to get home first...in the subway atm..

@w1sht0l1v3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here,check this out. http://paste2.org/xU7AKhdw should be the same thing more or less done in SAI only.maybe a bit deprecated sybtaxes,since i've done the script some time ago.

Please sign in to comment.