aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Examples
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts/Examples')
-rw-r--r--src/server/scripts/Examples/example_creature.cpp16
-rw-r--r--src/server/scripts/Examples/example_escort.cpp46
-rw-r--r--src/server/scripts/Examples/example_gossip_codebox.cpp26
3 files changed, 44 insertions, 44 deletions
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp
index b32f5f93c27..11c94598267 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -144,7 +144,7 @@ class example_creature : public CreatureScript
// *** HANDLED FUNCTION ***
//Our Receive emote function
- void ReceiveEmote(Player* /*pPlayer*/, uint32 uiTextEmote)
+ void ReceiveEmote(Player* /*player*/, uint32 uiTextEmote)
{
me->HandleEmoteCommand(uiTextEmote);
@@ -263,23 +263,23 @@ class example_creature : public CreatureScript
return new example_creatureAI(creature);
}
- bool OnGossipHello(Player* pPlayer, Creature* creature)
+ bool OnGossipHello(Player* player, Creature* creature)
{
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
- pPlayer->SEND_GOSSIP_MENU(907, creature->GetGUID());
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
+ player->SEND_GOSSIP_MENU(907, creature->GetGUID());
return true;
}
- bool OnGossipSelect(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
- pPlayer->PlayerTalkClass->ClearMenus();
+ player->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
{
- pPlayer->CLOSE_GOSSIP_MENU();
+ player->CLOSE_GOSSIP_MENU();
//Set our faction to hostile towards all
creature->setFaction(FACTION_WORGEN);
- creature->AI()->AttackStart(pPlayer);
+ creature->AI()->AttackStart(player);
}
return true;
diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index 9c173f73b95..cfd5b90d7dc 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -87,12 +87,12 @@ class example_escort : public CreatureScript
me->SummonCreature(NPC_FELBOAR, me->GetPositionX()+5.0f, me->GetPositionY()+7.0f, me->GetPositionZ(), 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 3000);
break;
case 4:
- if (Player* pPlayer = GetPlayerForEscort())
+ if (Player* player = GetPlayerForEscort())
{
//pTmpPlayer is the target of the text
- DoScriptText(SAY_WP_3, me, pPlayer);
+ DoScriptText(SAY_WP_3, me, player);
//pTmpPlayer is the source of the text
- DoScriptText(SAY_WP_4, pPlayer);
+ DoScriptText(SAY_WP_4, player);
}
break;
}
@@ -102,8 +102,8 @@ class example_escort : public CreatureScript
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- if (Player* pPlayer = GetPlayerForEscort())
- DoScriptText(SAY_AGGRO1, me, pPlayer);
+ if (Player* player = GetPlayerForEscort())
+ DoScriptText(SAY_AGGRO1, me, player);
}
else
DoScriptText(SAY_AGGRO2, me);
@@ -119,15 +119,15 @@ class example_escort : public CreatureScript
{
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
- if (Player* pPlayer = GetPlayerForEscort())
+ if (Player* player = GetPlayerForEscort())
{
// not a likely case, code here for the sake of example
if (pKiller == me)
{
- DoScriptText(SAY_DEATH_1, me, pPlayer);
+ DoScriptText(SAY_DEATH_1, me, player);
}
else
- DoScriptText(SAY_DEATH_2, me, pPlayer);
+ DoScriptText(SAY_DEATH_2, me, player);
}
}
else
@@ -183,44 +183,44 @@ class example_escort : public CreatureScript
return new example_escortAI(creature);
}
- bool OnGossipHello(Player* pPlayer, Creature* creature)
+ bool OnGossipHello(Player* player, Creature* creature)
{
- pPlayer->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
- pPlayer->PrepareGossipMenu(creature, 0);
+ player->TalkedToCreature(creature->GetEntry(), creature->GetGUID());
+ player->PrepareGossipMenu(creature, 0);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
- pPlayer->SendPreparedGossip(creature);
+ player->SendPreparedGossip(creature);
return true;
}
- bool OnGossipSelect(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
- pPlayer->PlayerTalkClass->ClearMenus();
+ player->PlayerTalkClass->ClearMenus();
npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, creature->AI());
switch(uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
- pPlayer->CLOSE_GOSSIP_MENU();
+ player->CLOSE_GOSSIP_MENU();
if (pEscortAI)
- pEscortAI->Start(true, true, pPlayer->GetGUID());
+ pEscortAI->Start(true, true, player->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+2:
- pPlayer->CLOSE_GOSSIP_MENU();
+ player->CLOSE_GOSSIP_MENU();
if (pEscortAI)
- pEscortAI->Start(false, false, pPlayer->GetGUID());
+ pEscortAI->Start(false, false, player->GetGUID());
break;
case GOSSIP_ACTION_INFO_DEF+3:
- pPlayer->CLOSE_GOSSIP_MENU();
+ player->CLOSE_GOSSIP_MENU();
if (pEscortAI)
- pEscortAI->Start(false, true, pPlayer->GetGUID());
+ pEscortAI->Start(false, true, player->GetGUID());
break;
default:
return false; // nothing defined -> trinity core handling
diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index 30d9f27f400..13680a8ea9c 100644
--- a/src/server/scripts/Examples/example_gossip_codebox.cpp
+++ b/src/server/scripts/Examples/example_gossip_codebox.cpp
@@ -48,47 +48,47 @@ class example_gossip_codebox : public CreatureScript
{
}
- bool OnGossipHello(Player* pPlayer, Creature* creature)
+ bool OnGossipHello(Player* player, Creature* creature)
{
- pPlayer->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
- pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
+ player->ADD_GOSSIP_ITEM_EXTENDED(0, GOSSIP_ITEM_1, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1, "", 0, true);
+ player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_2, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+2);
- pPlayer->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
+ player->PlayerTalkClass->SendGossipMenu(907, creature->GetGUID());
return true;
}
- bool OnGossipSelect(Player* pPlayer, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
{
- pPlayer->PlayerTalkClass->ClearMenus();
+ player->PlayerTalkClass->ClearMenus();
if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
{
DoScriptText(SAY_NOT_INTERESTED, creature);
- pPlayer->CLOSE_GOSSIP_MENU();
+ player->CLOSE_GOSSIP_MENU();
}
return true;
}
- bool OnGossipSelectCode(Player* pPlayer, Creature* creature, uint32 uiSender, uint32 uiAction, const char* code)
+ bool OnGossipSelectCode(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction, const char* code)
{
- pPlayer->PlayerTalkClass->ClearMenus();
+ player->PlayerTalkClass->ClearMenus();
if (uiSender == GOSSIP_SENDER_MAIN)
{
switch (uiAction)
{
case GOSSIP_ACTION_INFO_DEF+1:
- if (std::strcmp(code, pPlayer->GetName()) != 0)
+ if (std::strcmp(code, player->GetName()) != 0)
{
DoScriptText(SAY_WRONG, creature);
- creature->CastSpell(pPlayer, SPELL_POLYMORPH, true);
+ creature->CastSpell(player, SPELL_POLYMORPH, true);
}
else
{
DoScriptText(SAY_CORRECT, creature);
- creature->CastSpell(pPlayer, SPELL_MARK_OF_THE_WILD, true);
+ creature->CastSpell(player, SPELL_MARK_OF_THE_WILD, true);
}
- pPlayer->CLOSE_GOSSIP_MENU();
+ player->CLOSE_GOSSIP_MENU();
return true;
}