Scripts/Pet Implemented Argent Squire/Gruntling and Argent Pony Bridle

This commit is contained in:
Gustavo
2016-08-25 03:31:48 -03:00
committed by Aokromes
parent 5643a150ad
commit 49d4e22c6a
3 changed files with 314 additions and 0 deletions

View File

@@ -0,0 +1,108 @@
SET @ID :=1111; -- currently free in tdb
DELETE FROM `spell_group` WHERE `id`=@ID;
INSERT INTO `spell_group` (`id`,`spell_id`) VALUES
(@ID,62727),
(@ID,63443),
(@ID,63439),
(@ID,63442),
(@ID,63440),
(@ID,63446),
(@ID,63441),
(@ID,63444),
(@ID,63438),
(@ID,63445);
DELETE FROM `spell_group_stack_rules` WHERE `group_id`=@ID;
INSERT INTO `spell_group_stack_rules` (`group_id`,`stack_rule`) VALUES
(@ID,1);
DELETE FROM `spell_script_names` WHERE `spell_id`=67039;
INSERT INTO `spell_script_names` (`spell_id`, `ScriptName`) VALUES
(67039, 'spell_gen_pony_mount_check');
DELETE FROM `creature_template_addon` WHERE `entry` IN (33238,33239);
INSERT INTO `creature_template_addon` (`entry`, `path_id`, `mount`, `bytes1`, `bytes2`, `emote`, `auras`) VALUES
(33238, 0, 0, 0, 1, 0, 67039),
(33239, 0, 0, 0, 1, 0, 67039);
DELETE FROM `spell_linked_spell` WHERE `spell_effect`=67401;
INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`, `type`, `comment`) VALUES
(-67368, 67401, 0, 'Argent Squire - Bank'),
(-67377, 67401, 0, 'Argent Squire - Shop'),
(-67376, 67401, 0, 'Argent Squire - Mail');
DELETE FROM `gossip_menu` WHERE `entry`=10317;
INSERT INTO `gossip_menu` (`entry`, `text_id`) VALUES
(10317, 14372);
DELETE FROM `gossip_menu_option` WHERE `menu_id`IN (10318,10317);
INSERT INTO `gossip_menu_option` (`menu_id`, `id`, `option_icon`, `option_text`, `option_id`, `npc_option_npcflag`, `action_menu_id`, `action_poi_id`, `box_coded`, `box_money`, `box_text`) VALUES
(10318, 0, 6, 'Visit a bank', 9, 1, 0, 0, 0, 0, ''),
(10318, 1, 1, 'Visit a trader', 3, 1, 0, 0, 0, 0, ''),
(10318, 2, 0, 'Visit a mailbox', 1, 1, 0, 0, 0, 0, ''),
(10318, 3, 0, 'Darnassus Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10318, 4, 0, 'Exodar Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10318, 5, 0, 'Gnomeregan Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10318, 6, 0, 'Ironforge Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10318, 7, 0, 'Stormwind Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10317, 0, 6, 'Visit a bank', 9, 1, 0, 0, 0, 0, ''),
(10317, 1, 1, 'Visit a trader', 3, 1, 0, 0, 0, 0, ''),
(10317, 2, 0, 'Visit a mailbox', 1, 1, 0, 0, 0, 0, ''),
(10317, 3, 0, 'Sen Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10317, 4, 0, 'Undercity Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10317, 5, 0, 'Orgrimmar Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10317, 6, 0, 'Silvermoon Champion\'s Pennant', 1, 1, 0, 0, 0, 0, ''),
(10317, 7, 0, 'Thunder Bluff Champion\'s Pennant', 1, 1, 0, 0, 0, 0, '');
UPDATE `creature_template` SET `npcflag`=129, `ScriptName`='npc_argent_squire_gruntling' WHERE `entry`=33238;
UPDATE `creature_template` SET `gossip_menu_id`=10317, `npcflag`=129, `ScriptName`='npc_argent_squire_gruntling' WHERE `entry`=33239;
DELETE FROM `conditions` WHERE `SourceTypeOrReferenceId`=15 AND `SourceGroup` IN (10318,10317);
INSERT INTO `conditions` (`SourceTypeOrReferenceId`, `SourceGroup`, `SourceEntry`, `SourceId`, `ElseGroup`, `ConditionTypeOrReference`, `ConditionTarget`, `ConditionValue1`, `ConditionValue2`, `ConditionValue3`, `NegativeCondition`, `ErrorTextId`, `ScriptName`, `Comment`) VALUES
(15, 10318, 0, 0, 0, 1, 1, 67368, 0, 0, 0, 0, '', 'Argent squire show Visit a bank if has bank errand aura'),
(15, 10318, 0, 0, 1, 17, 0, 3736, 0, 0, 0, 0, '', 'Argent squire show Visit a bank if player has achievement pony up'),
(15, 10318, 0, 0, 1, 1, 1, 67401, 0, 0, 1, 0, '', 'Argent squire show Visit a bank no tired aura'),
(15, 10318, 0, 0, 1, 1, 0, 67334, 0, 0, 1, 0, '', 'Argent squire show Visit a bank no tired aura on player'),
(15, 10318, 0, 0, 1, 1, 1, 67377, 0, 0, 1, 0, '', 'Argent squire show Visit a bank no shop aura'),
(15, 10318, 0, 0, 1, 1, 1, 67376, 0, 0, 1, 0, '', 'Argent squire show Visit a bank no Postman aura'),
(15, 10318, 1, 0, 0, 1, 1, 67377, 0, 0, 0, 0, '', 'Argent squire show Visit a trader if has shop aura'),
(15, 10318, 1, 0, 1, 17, 0, 3736, 0, 0, 0, 0, '', 'Argent squire show Visit a trader if player has achievement pony up'),
(15, 10318, 1, 0, 1, 1, 1, 67401, 0, 0, 1, 0, '', 'Argent squire show Visit a trader no tired aura'),
(15, 10318, 1, 0, 1, 1, 0, 67334, 0, 0, 1, 0, '', 'Argent squire show Visit a trader no tired aura on player'),
(15, 10318, 1, 0, 1, 1, 1, 67368, 0, 0, 1, 0, '', 'Argent squire show Visit a trader no bank errand aura'),
(15, 10318, 1, 0, 1, 1, 1, 67376, 0, 0, 1, 0, '', 'Argent squire show Visit a trader no Postman aura'),
(15, 10318, 2, 0, 0, 1, 1, 67376, 0, 0, 0, 0, '', 'Argent squire show Visit a Mailbox if has Postman aura'),
(15, 10318, 2, 0, 1, 17, 0, 3736, 0, 0, 0, 0, '', 'Argent squire show Visit a Mailbox if player has achievement pony up'),
(15, 10318, 2, 0, 1, 1, 1, 67401, 0, 0, 1, 0, '', 'Argent squire show Visit a Mailbox no tired aura'),
(15, 10318, 2, 0, 1, 1, 0, 67334, 0, 0, 1, 0, '', 'Argent squire show Visit a Mailbox no tired aura on player'),
(15, 10318, 2, 0, 1, 1, 1, 67368, 0, 0, 1, 0, '', 'Argent squire show Visit a Mailbox no bank errand aura'),
(15, 10318, 2, 0, 1, 1, 1, 67377, 0, 0, 1, 0, '', 'Argent squire show Visit a Mailbox no shop aura'),
(15, 10318, 3, 0, 0, 8, 0, 13725, 0, 0, 0, 0, '', 'Argent squire show Darnassus Champion\'s Pennant if player has completed Champion of Darnassus'),
(15, 10318, 4, 0, 0, 8, 0, 13724, 0, 0, 0, 0, '', 'Argent squire show Exodar Champion\'s Pennant if player has completed Champion of the Exodar'),
(15, 10318, 5, 0, 0, 8, 0, 13723, 0, 0, 0, 0, '', 'Argent squire show Gnomeeregan Champion\'s Pennant if player has completed Champion of Gnomeregan'),
(15, 10318, 6, 0, 0, 8, 0, 13713, 0, 0, 0, 0, '', 'Argent squire show Ironforge Champion\'s Pennant if player has completed Champion of Ironforge'),
(15, 10318, 7, 0, 0, 8, 0, 13699, 0, 0, 0, 0, '', 'Argent squire show Stormwind Champion\'s Pennant if player has completed Champion of Stormwind'),
(15, 10317, 0, 0, 0, 1, 1, 68849, 0, 0, 0, 0, '', 'Argent Gruntling show Visit a bank if has bank errand aura'),
(15, 10317, 0, 0, 1, 17, 0, 3736, 0, 0, 0, 0, '', 'Argent Gruntling show Visit a bank if player has achievement pony up'),
(15, 10317, 0, 0, 1, 1, 1, 68852, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a bank no tired aura'),
(15, 10317, 0, 0, 1, 1, 0, 67334, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a bank no tired aura on player'),
(15, 10317, 0, 0, 1, 1, 1, 68851, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a bank no shop aura'),
(15, 10317, 0, 0, 1, 1, 1, 68850, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a bank no Postman aura'),
(15, 10317, 1, 0, 0, 1, 1, 68851, 0, 0, 0, 0, '', 'Argent Gruntling show Visit a trader if has shop aura'),
(15, 10317, 1, 0, 1, 17, 0, 3736, 0, 0, 0, 0, '', 'Argent Gruntling show Visit a trader if player has achievement pony up'),
(15, 10317, 1, 0, 1, 1, 1, 68852, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a trader no tired aura'),
(15, 10317, 1, 0, 1, 1, 0, 67334, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a trader no tired aura on player'),
(15, 10317, 1, 0, 1, 1, 1, 68849, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a trader no bank errand aura'),
(15, 10317, 1, 0, 1, 1, 1, 68850, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a trader no Postman aura'),
(15, 10317, 2, 0, 0, 1, 1, 68850, 0, 0, 0, 0, '', 'Argent Gruntling show Visit a Mailbox if has Postman aura'),
(15, 10317, 2, 0, 1, 17, 0, 3736, 0, 0, 0, 0, '', 'Argent Gruntling show Visit a Mailbox if player has achievement pony up'),
(15, 10317, 2, 0, 1, 1, 1, 68852, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a Mailbox no tired aura'),
(15, 10317, 2, 0, 1, 1, 0, 67334, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a Mailbox no tired aura on player'),
(15, 10317, 2, 0, 1, 1, 1, 68849, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a Mailbox no bank errand aura'),
(15, 10317, 2, 0, 1, 1, 1, 68851, 0, 0, 1, 0, '', 'Argent Gruntling show Visit a Mailbox no shop aura'),
(15, 10317, 3, 0, 0, 8, 0, 13727, 0, 0, 0, 0, '', 'Argent Gruntling show Sen\'jin Champion\'s Pennant if player has completed Champion of Sen\'jin'),
(15, 10317, 4, 0, 0, 8, 0, 13729, 0, 0, 0, 0, '', 'Argent Gruntling show Undercity Champion\'s Pennant if player has completed Champion of the Undercity'),
(15, 10317, 5, 0, 0, 8, 0, 13726, 0, 0, 0, 0, '', 'Argent Gruntling show Orgrimmar Champion\'s Pennant if player has completed Champion of Orgrimmar'),
(15, 10317, 6, 0, 0, 8, 0, 13731, 0, 0, 0, 0, '', 'Argent Gruntling show Silvermoon Champion\'s Pennant if player has completed Champion of Silvermoon City'),
(15, 10317, 7, 0, 0, 8, 0, 13728, 0, 0, 0, 0, '', 'Argent Gruntling show Thunder Bluff Champion\'s Pennant if player has completed Champion of Thunder Bluff');

View File

@@ -4185,6 +4185,52 @@ class spell_gen_clear_debuffs : public SpellScriptLoader
}
};
enum PonySpells
{
ACHIEV_PONY_UP = 3736,
MOUNT_PONY = 29736
};
class spell_gen_pony_mount_check : public SpellScriptLoader
{
public:
spell_gen_pony_mount_check() : SpellScriptLoader("spell_gen_pony_mount_check") { }
class spell_gen_pony_mount_check_AuraScript : public AuraScript
{
PrepareAuraScript(spell_gen_pony_mount_check_AuraScript);
void HandleEffectPeriodic(AuraEffect const* /*aurEff*/)
{
Unit* caster = GetCaster();
Player* owner = caster->GetOwner()->ToPlayer();
if (!caster || !owner || !owner->HasAchieved(ACHIEV_PONY_UP))
return;
if (owner->IsMounted())
{
caster->Mount(MOUNT_PONY);
caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
}
else if (caster->IsMounted())
{
caster->Dismount();
caster->SetSpeedRate(MOVE_RUN, owner->GetSpeedRate(MOVE_RUN));
}
}
void Register() override
{
OnEffectPeriodic += AuraEffectPeriodicFn(spell_gen_pony_mount_check_AuraScript::HandleEffectPeriodic, EFFECT_0, SPELL_AURA_PERIODIC_DUMMY);
}
};
AuraScript* GetAuraScript() const
{
return new spell_gen_pony_mount_check_AuraScript();
}
};
void AddSC_generic_spell_scripts()
{
new spell_gen_absorb0_hitlimit1();
@@ -4274,4 +4320,5 @@ void AddSC_generic_spell_scripts()
new spell_gen_mixology_bonus();
new spell_gen_landmine_knockback_achievement();
new spell_gen_clear_debuffs();
new spell_gen_pony_mount_check();
}

View File

@@ -2522,6 +2522,164 @@ class npc_train_wrecker : public CreatureScript
}
};
/*######
## npc_argent_squire/gruntling
######*/
enum Pennants
{
SPELL_DARNASSUS_PENNANT = 63443,
SPELL_EXODAR_PENNANT = 63439,
SPELL_GNOMEREGAN_PENNANT = 63442,
SPELL_IRONFORGE_PENNANT = 63440,
SPELL_STORMWIND_PENNANT = 62727,
SPELL_SENJIN_PENNANT = 63446,
SPELL_UNDERCITY_PENNANT = 63441,
SPELL_ORGRIMMAR_PENNANT = 63444,
SPELL_SILVERMOON_PENNANT = 63438,
SPELL_THUNDERBLUFF_PENNANT = 63445,
SPELL_AURA_POSTMAN_S = 67376,
SPELL_AURA_SHOP_S = 67377,
SPELL_AURA_BANK_S = 67368,
SPELL_AURA_TIRED_S = 67401,
SPELL_AURA_BANK_G = 68849,
SPELL_AURA_POSTMAN_G = 68850,
SPELL_AURA_SHOP_G = 68851,
SPELL_AURA_TIRED_G = 68852,
SPELL_TIRED_PLAYER = 67334
};
enum ArgentPetGossipOptions
{
GOSSIP_OPTION_BANK = 0,
GOSSIP_OPTION_SHOP = 1,
GOSSIP_OPTION_MAIL = 2,
GOSSIP_OPTION_DARNASSUS_SENJIN_PENNANT = 3,
GOSSIP_OPTION_EXODAR_UNDERCITY_PENNANT = 4,
GOSSIP_OPTION_GNOMEREGAN_ORGRIMMAR_PENNANT = 5,
GOSSIP_OPTION_IRONFORGE_SILVERMOON_PENNANT = 6,
GOSSIP_OPTION_STORMWIND_THUNDERBLUFF_PENNANT = 7
};
enum Misc
{
NPC_ARGENT_SQUIRE = 33238
};
struct ArgentPonyBannerSpells
{
uint32 spellSquire;
uint32 spellGruntling;
};
ArgentPonyBannerSpells const bannerSpells[5] =
{
{ SPELL_DARNASSUS_PENNANT, SPELL_SENJIN_PENNANT },
{ SPELL_EXODAR_PENNANT, SPELL_UNDERCITY_PENNANT },
{ SPELL_GNOMEREGAN_PENNANT, SPELL_ORGRIMMAR_PENNANT },
{ SPELL_IRONFORGE_PENNANT, SPELL_SILVERMOON_PENNANT },
{ SPELL_STORMWIND_PENNANT, SPELL_THUNDERBLUFF_PENNANT }
};
class npc_argent_squire_gruntling : public CreatureScript
{
public:
npc_argent_squire_gruntling() : CreatureScript("npc_argent_squire_gruntling") { }
struct npc_argent_squire_gruntlingAI : public ScriptedAI
{
npc_argent_squire_gruntlingAI(Creature* creature) : ScriptedAI(creature)
{
ScheduleTasks();
}
void ScheduleTasks()
{
_scheduler
.Schedule(Seconds(1), [this](TaskContext /*context*/)
{
if (Aura* ownerTired = me->GetOwner()->GetAura(SPELL_TIRED_PLAYER))
if (Aura* squireTired = me->AddAura(IsArgentSquire() ? SPELL_AURA_TIRED_S : SPELL_AURA_TIRED_G, me))
squireTired->SetDuration(ownerTired->GetDuration());
})
.Schedule(Seconds(1), [this](TaskContext context)
{
if ((me->HasAura(SPELL_AURA_TIRED_S) || me->HasAura(SPELL_AURA_TIRED_G)) && me->HasFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR))
me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER | UNIT_NPC_FLAG_MAILBOX | UNIT_NPC_FLAG_VENDOR);
context.Repeat();
});
}
void sGossipSelect(Player* player, uint32 /*menuId*/, uint32 gossipListId) override
{
switch (gossipListId)
{
case GOSSIP_OPTION_BANK:
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_BANKER);
uint32 _bankAura = IsArgentSquire() ? SPELL_AURA_BANK_S : SPELL_AURA_BANK_G;
if (!me->HasAura(_bankAura))
DoCastSelf(_bankAura);
if (!player->HasAura(SPELL_TIRED_PLAYER))
player->CastSpell(player, SPELL_TIRED_PLAYER, true);
break;
}
case GOSSIP_OPTION_SHOP:
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_VENDOR);
uint32 _shopAura = IsArgentSquire() ? SPELL_AURA_SHOP_S : SPELL_AURA_SHOP_G;
if (!me->HasAura(_shopAura))
DoCastSelf(_shopAura);
if (!player->HasAura(SPELL_TIRED_PLAYER))
player->CastSpell(player, SPELL_TIRED_PLAYER, true);
break;
}
case GOSSIP_OPTION_MAIL:
{
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_MAILBOX);
player->GetSession()->SendShowMailBox(me->GetGUID());
uint32 _mailAura = IsArgentSquire() ? SPELL_AURA_POSTMAN_S : SPELL_AURA_POSTMAN_G;
if (!me->HasAura(_mailAura))
DoCastSelf(_mailAura);
if (!player->HasAura(SPELL_TIRED_PLAYER))
player->CastSpell(player, SPELL_TIRED_PLAYER, true);
break;
}
case GOSSIP_OPTION_DARNASSUS_SENJIN_PENNANT:
case GOSSIP_OPTION_EXODAR_UNDERCITY_PENNANT:
case GOSSIP_OPTION_GNOMEREGAN_ORGRIMMAR_PENNANT:
case GOSSIP_OPTION_IRONFORGE_SILVERMOON_PENNANT:
case GOSSIP_OPTION_STORMWIND_THUNDERBLUFF_PENNANT:
if (IsArgentSquire())
DoCastSelf(bannerSpells[gossipListId - 3].spellSquire, true);
else
DoCastSelf(bannerSpells[gossipListId - 3].spellGruntling, true);
break;
}
player->PlayerTalkClass->SendCloseGossip();
}
void UpdateAI(uint32 diff) override
{
_scheduler.Update(diff);
}
bool IsArgentSquire() const { return me->GetEntry() == NPC_ARGENT_SQUIRE; }
private:
TaskScheduler _scheduler;
};
CreatureAI* GetAI(Creature *creature) const override
{
return new npc_argent_squire_gruntlingAI(creature);
}
};
void AddSC_npcs_special()
{
new npc_air_force_bots();
@@ -2547,4 +2705,5 @@ void AddSC_npcs_special()
new npc_imp_in_a_ball();
new npc_stable_master();
new npc_train_wrecker();
new npc_argent_squire_gruntling();
}