Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement PTR Paymaster ScriptDev #536

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sql/scriptdev2/scriptdev2.sql
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ UPDATE creature_template SET ScriptName='npc_dirty_larry' WHERE entry=19720;
UPDATE creature_template SET ScriptName='npc_khadgars_servant' WHERE entry=19685;
UPDATE creature_template SET ScriptName='npc_salsalabim' WHERE entry=18584;
UPDATE creature_template SET ScriptName='npc_adal' WHERE entry IN(18481);
UPDATE creature_template SET ScriptName="npc_paymaster" WHERE entry=26075;

/* SILITHUS */
UPDATE creature_template SET ScriptName='npc_anachronos_the_ancient' WHERE entry=15381;
Expand Down
110 changes: 110 additions & 0 deletions src/game/AI/ScriptDevAI/scripts/world/npcs_special.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2820,6 +2820,110 @@ bool GossipHello_npc_gossip_npc(Player* player, Creature* creature)
return true;
}

bool GossipHello_npc_paymaster(Player* pPlayer, Creature* pCreature)
Copy link
Contributor

Choose a reason for hiding this comment

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

I do not understand why the hello part is not in DB.

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 don't know if there are broadcast texts for it etc.

{
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "5,000 Gold", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Profession Trainer", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "I want to be Aldor.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 2);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Let's go Scryer.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 3);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Oh great Flaskataur, grant me reputation with all the Outland factions.", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 4);
pPlayer->SEND_GOSSIP_MENU(39288, pCreature->GetObjectGuid());
return true;
}

bool GossipSelect_npc_paymaster(Player* pPlayer, Creature* pCreature, uint32 /*uiSender*/, uint32 uiAction)
{
if (uiAction > GOSSIP_ACTION_INFO_DEF + 4 && pPlayer->GetFreePrimaryProfessionPoints() == 0)
return false;

FactionEntry const* factionEntry;
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF:
pPlayer->CastSpell(pPlayer, 46642, TRIGGERED_OLD_TRIGGERED);
break;
case GOSSIP_ACTION_INFO_DEF + 1:
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Jewelcrafting", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 5);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Alchemy", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 6);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Blacksmithing", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 7);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Enchanting", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 8);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Engineering", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 9);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Herbalism", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 10);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Leatherworking", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Mining", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 12);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Skinning", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 13);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "Tailoring", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 14);
pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, "First Aid", GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 15);
pPlayer->SEND_GOSSIP_MENU(39288, pCreature->GetObjectGuid());
return true;
case GOSSIP_ACTION_INFO_DEF + 2:
factionEntry = sFactionStore.LookupEntry<FactionEntry>(932);
pPlayer->GetReputationMgr().ModifyReputation(factionEntry, 84000);
break;
case GOSSIP_ACTION_INFO_DEF + 3:
factionEntry = sFactionStore.LookupEntry<FactionEntry>(934);
pPlayer->GetReputationMgr().ModifyReputation(factionEntry, 84000);
pPlayer->CLOSE_GOSSIP_MENU();
return true;
case GOSSIP_ACTION_INFO_DEF + 4:
factionEntry = sFactionStore.LookupEntry<FactionEntry>(967);
pPlayer->GetReputationMgr().ModifyReputation(factionEntry, 84000);
factionEntry = sFactionStore.LookupEntry<FactionEntry>(990);
pPlayer->GetReputationMgr().ModifyReputation(factionEntry, 84000);
factionEntry = sFactionStore.LookupEntry<FactionEntry>(1012);
pPlayer->GetReputationMgr().ModifyReputation(factionEntry, 84000);
break;
case GOSSIP_ACTION_INFO_DEF + 5:
pPlayer->learnSpellHighRank(28897);
pPlayer->SetSkill(755, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 6:
pPlayer->learnSpellHighRank(28596);
pPlayer->SetSkill(171, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 7:
pPlayer->learnSpellHighRank(29844);
pPlayer->SetSkill(164, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 8:
pPlayer->learnSpellHighRank(28029);
pPlayer->SetSkill(333, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 9:
pPlayer->learnSpellHighRank(30350);
pPlayer->SetSkill(202, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 10:
pPlayer->learnSpellHighRank(28695);
pPlayer->SetSkill(182, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 11:
pPlayer->learnSpellHighRank(32549);
pPlayer->SetSkill(165, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 12:
pPlayer->learnSpellHighRank(29354);
pPlayer->SetSkill(186, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 13:
pPlayer->learnSpellHighRank(32678);
pPlayer->SetSkill(393, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 14:
pPlayer->learnSpellHighRank(26790);
pPlayer->SetSkill(197, 375, 375);
break;
case GOSSIP_ACTION_INFO_DEF + 15:
pPlayer->learnSpellHighRank(27028);
pPlayer->SetSkill(129, 375, 375);
break;
default:
return false;
}
pPlayer->CLOSE_GOSSIP_MENU();
return true;
}

void AddSC_npcs_special()
{
Script* pNewScript = new Script;
Expand Down Expand Up @@ -2936,6 +3040,12 @@ void AddSC_npcs_special()
pNewScript->pGossipHello = &GossipHello_npc_gossip_npc;
pNewScript->RegisterSelf();

pNewScript = new Script;
pNewScript->Name = "npc_paymaster";
pNewScript->pGossipHello = &GossipHello_npc_paymaster;
pNewScript->pGossipSelect = &GossipSelect_npc_paymaster;
pNewScript->RegisterSelf();

RegisterSpellScript<HarvestSilithidEgg>("spell_harvest_silithid_egg");
RegisterSpellScript<ImpInABottleSay>("spell_imp_in_a_bottle_say");
RegisterSpellScript<GossipNPCPeriodicTriggerFidget>("spell_gossip_npc_periodic_trigger_fidget");
Expand Down