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/CMakeLists.txt2
-rw-r--r--src/server/scripts/Examples/example_creature.cpp6
-rw-r--r--src/server/scripts/Examples/example_escort.cpp10
-rw-r--r--src/server/scripts/Examples/example_gossip_codebox.cpp10
-rw-r--r--src/server/scripts/Examples/example_spell.cpp4
5 files changed, 15 insertions, 17 deletions
diff --git a/src/server/scripts/Examples/CMakeLists.txt b/src/server/scripts/Examples/CMakeLists.txt
index 14002100713..dde6fe2c37c 100644
--- a/src/server/scripts/Examples/CMakeLists.txt
+++ b/src/server/scripts/Examples/CMakeLists.txt
@@ -1,4 +1,4 @@
-# Copyright (C) 2008-2011 TrinityCore <http://www.trinitycore.org/>
+# Copyright (C) 2008-2012 TrinityCore <http://www.trinitycore.org/>
#
# This file is free software; as a special exception the author gives
# unlimited permission to copy and/or distribute it, with or without
diff --git a/src/server/scripts/Examples/example_creature.cpp b/src/server/scripts/Examples/example_creature.cpp
index f1b336f07f9..7f75a0fb481 100644
--- a/src/server/scripts/Examples/example_creature.cpp
+++ b/src/server/scripts/Examples/example_creature.cpp
@@ -90,7 +90,7 @@ class example_creature : public CreatureScript
{
// *** HANDLED FUNCTION ***
//This is the constructor, called only once when the Creature is first created
- example_creatureAI(Creature* c) : ScriptedAI(c) {}
+ example_creatureAI(Creature* creature) : ScriptedAI(creature) {}
// *** CUSTOM VARIABLES ****
//These variables are for use only by this individual script.
@@ -271,10 +271,10 @@ class example_creature : public CreatureScript
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
- if (uiAction == GOSSIP_ACTION_INFO_DEF+1)
+ if (action == GOSSIP_ACTION_INFO_DEF+1)
{
player->CLOSE_GOSSIP_MENU();
//Set our faction to hostile towards all
diff --git a/src/server/scripts/Examples/example_escort.cpp b/src/server/scripts/Examples/example_escort.cpp
index cae09266b49..851a32538e9 100644
--- a/src/server/scripts/Examples/example_escort.cpp
+++ b/src/server/scripts/Examples/example_escort.cpp
@@ -75,9 +75,9 @@ class example_escort : public CreatureScript
}
// Pure Virtual Functions (Have to be implemented)
- void WaypointReached(uint32 uiWP)
+ void WaypointReached(uint32 waypointId)
{
- switch (uiWP)
+ switch (waypointId)
{
case 1:
DoScriptText(SAY_WP_1, me);
@@ -123,9 +123,7 @@ class example_escort : public CreatureScript
{
// not a likely case, code here for the sake of example
if (killer == me)
- {
DoScriptText(SAY_DEATH_1, me, player);
- }
else
DoScriptText(SAY_DEATH_2, me, player);
}
@@ -197,12 +195,12 @@ class example_escort : public CreatureScript
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
npc_escortAI* pEscortAI = CAST_AI(example_escort::example_escortAI, creature->AI());
- switch (uiAction)
+ switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
player->CLOSE_GOSSIP_MENU();
diff --git a/src/server/scripts/Examples/example_gossip_codebox.cpp b/src/server/scripts/Examples/example_gossip_codebox.cpp
index c288123f117..6d57f1ac798 100644
--- a/src/server/scripts/Examples/example_gossip_codebox.cpp
+++ b/src/server/scripts/Examples/example_gossip_codebox.cpp
@@ -58,10 +58,10 @@ class example_gossip_codebox : public CreatureScript
return true;
}
- bool OnGossipSelect(Player* player, Creature* creature, uint32 /*uiSender*/, uint32 uiAction)
+ bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
- if (uiAction == GOSSIP_ACTION_INFO_DEF+2)
+ if (action == GOSSIP_ACTION_INFO_DEF+2)
{
DoScriptText(SAY_NOT_INTERESTED, creature);
player->CLOSE_GOSSIP_MENU();
@@ -70,12 +70,12 @@ class example_gossip_codebox : public CreatureScript
return true;
}
- bool OnGossipSelectCode(Player* player, Creature* creature, uint32 uiSender, uint32 uiAction, const char* code)
+ bool OnGossipSelectCode(Player* player, Creature* creature, uint32 sender, uint32 action, const char* code)
{
player->PlayerTalkClass->ClearMenus();
- if (uiSender == GOSSIP_SENDER_MAIN)
+ if (sender == GOSSIP_SENDER_MAIN)
{
- switch (uiAction)
+ switch (action)
{
case GOSSIP_ACTION_INFO_DEF+1:
if (std::strcmp(code, player->GetName()) != 0)
diff --git a/src/server/scripts/Examples/example_spell.cpp b/src/server/scripts/Examples/example_spell.cpp
index 71dbd7f4fb0..70d7f43135c 100644
--- a/src/server/scripts/Examples/example_spell.cpp
+++ b/src/server/scripts/Examples/example_spell.cpp
@@ -92,7 +92,7 @@ class spell_ex_5581 : public SpellScriptLoader
void HandleAfterCast()
{
- sLog->outString("All immediate actions for the spell are finished now");
+ sLog->outString("All immediate Actions for the spell are finished now");
// this is a safe for triggering additional effects for a spell without interfering
// with visuals or with other effects of the spell
//GetCaster()->CastSpell(target, SPELL_TRIGGERED, true);
@@ -102,7 +102,7 @@ class spell_ex_5581 : public SpellScriptLoader
{
// in this hook you can add additional requirements for spell caster (and throw a client error if reqs're not passed)
// in this case we're disallowing to select non-player as a target of the spell
- //if (!GetTargetUnit() || GetTargetUnit()->ToPlayer())
+ //if (!GetExplTargetUnit() || GetExplTargetUnit()->ToPlayer())
//return SPELL_FAILED_BAD_TARGETS;
return SPELL_CAST_OK;
}