aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjoschiwald <joschiwald@online.de>2013-11-24 21:49:51 +0100
committerjoschiwald <joschiwald@online.de>2013-11-24 21:49:51 +0100
commit9a0bb93b336e30619d2c59bd3c0f902bc1e61d23 (patch)
tree3377e1d535e73ef784a8daad5fa965281a1241cb /src
parent2c307aa67c713fef0c13956f640daa6263062327 (diff)
Scripts: fix warning and cleanup npc_apprentice_mirveda
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/Unit/Unit.cpp2
-rw-r--r--src/server/game/Entities/Unit/Unit.h2
-rw-r--r--src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp66
-rw-r--r--src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp4
4 files changed, 28 insertions, 46 deletions
diff --git a/src/server/game/Entities/Unit/Unit.cpp b/src/server/game/Entities/Unit/Unit.cpp
index 2cb767a6b4d..54db2da73df 100644
--- a/src/server/game/Entities/Unit/Unit.cpp
+++ b/src/server/game/Entities/Unit/Unit.cpp
@@ -241,8 +241,6 @@ Unit::Unit(bool isWorldObject) :
for (uint8 i = 0; i < MAX_SPELL_SCHOOL; ++i)
m_threatModifier[i] = 1.0f;
- m_isSorted = true;
-
for (uint8 i = 0; i < MAX_MOVE_TYPE; ++i)
m_speed_rate[i] = 1.0f;
diff --git a/src/server/game/Entities/Unit/Unit.h b/src/server/game/Entities/Unit/Unit.h
index 4091ea15662..84c687a2cce 100644
--- a/src/server/game/Entities/Unit/Unit.h
+++ b/src/server/game/Entities/Unit/Unit.h
@@ -2158,7 +2158,7 @@ class Unit : public WorldObject
typedef std::list<GameObject*> GameObjectList;
GameObjectList m_gameObj;
- bool m_isSorted;
+
uint32 m_transform;
Spell* m_currentSpells[CURRENT_MAX_SPELL];
diff --git a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
index cd96316acb4..6bc9aab3d6f 100644
--- a/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
+++ b/src/server/scripts/EasternKingdoms/zone_eversong_woods.cpp
@@ -67,43 +67,12 @@ class npc_apprentice_mirveda : public CreatureScript
public:
npc_apprentice_mirveda() : CreatureScript("npc_apprentice_mirveda") { }
- bool OnQuestReward(Player* /*player*/, Creature* creature, const Quest* quest, uint32 /*slot*/) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_CORRUPTED_SOIL)
- {
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->events.ScheduleEvent(EVENT_TALK, 2000);
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->CorruptedSoil = true;
- }
- return true;
- }
-
- bool OnQuestAccept(Player* player, Creature* creature, Quest const* quest) OVERRIDE
- {
- if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT)
- {
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->me->setFaction(FACTION_COMBAT);
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->events.ScheduleEvent(EVENT_SUMMON, 1000);
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->Summon = true;
- CAST_AI(npc_apprentice_mirveda::npc_apprentice_mirvedaAI, creature->AI())->PlayerGUID = player->GetGUID();
- }
- return true;
- }
-
- CreatureAI* GetAI(Creature* creature) const OVERRIDE
- {
- return new npc_apprentice_mirvedaAI(creature);
- }
-
struct npc_apprentice_mirvedaAI : public ScriptedAI
{
npc_apprentice_mirvedaAI(Creature* creature) : ScriptedAI(creature), Summons(me) { }
uint32 KillCount;
uint64 PlayerGUID;
- bool CorruptedSoil;
- bool Summon;
SummonList Summons;
EventMap events;
@@ -113,8 +82,26 @@ public:
KillCount = 0;
PlayerGUID = 0;
Summons.DespawnAll();
- CorruptedSoil = false;
- Summon = false;
+ }
+
+ void sQuestReward(Player* /*player*/, Quest const* quest, uint32 /*opt*/) OVERRIDE
+ {
+ if (quest->GetQuestId() == QUEST_CORRUPTED_SOIL)
+ {
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ events.ScheduleEvent(EVENT_TALK, 2000);
+ }
+ }
+
+ void sQuestAccept(Player* player, Quest const* quest) OVERRIDE
+ {
+ if (quest->GetQuestId() == QUEST_UNEXPECTED_RESULT)
+ {
+ me->setFaction(FACTION_COMBAT);
+ me->RemoveFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
+ events.ScheduleEvent(EVENT_SUMMON, 1000);
+ PlayerGUID = player->GetGUID();
+ }
}
void EnterCombat(Unit* /*who*/) OVERRIDE
@@ -163,24 +150,16 @@ public:
switch (eventId)
{
case EVENT_TALK:
- if (!CorruptedSoil)
- continue;
Talk(SAY_TEST_SOIL);
events.ScheduleEvent(EVENT_ADD_QUEST_GIVER_FLAG, 7000);
break;
case EVENT_ADD_QUEST_GIVER_FLAG:
- if (!CorruptedSoil)
- continue;
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
- CorruptedSoil = false;
break;
case EVENT_SUMMON:
- if (!Summon)
- continue;
me->SummonCreature(NPC_GHARZUL, 8749.505f, -7132.595f, 35.31983f, 3.816502f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 180000);
me->SummonCreature(NPC_ANGERSHADE, 8755.38f, -7131.521f, 35.30957f, 3.816502f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 180000);
me->SummonCreature(NPC_ANGERSHADE, 8753.199f, -7125.975f, 35.31986f, 3.816502f, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 180000);
- Summon = false;
break;
case EVENT_FIREBALL:
if (!UpdateVictim())
@@ -195,6 +174,11 @@ public:
DoMeleeAttackIfReady();
}
};
+
+ CreatureAI* GetAI(Creature* creature) const OVERRIDE
+ {
+ return new npc_apprentice_mirvedaAI(creature);
+ }
};
/*######
diff --git a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
index e4ffe24754a..4b24e5a81fb 100644
--- a/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
+++ b/src/server/scripts/Northrend/Nexus/Oculus/oculus.cpp
@@ -154,7 +154,7 @@ class npc_verdisa_beglaristrasz_eternos : public CreatureScript
}
return;
case GOSSIP_MENU_BELGARISTRASZ:
- if (gossipListId >= 0 && gossipListId <= 2)
+ if (gossipListId <= 2)
{
if (gossipListId == 1)
RemoveEssence(player, ITEM_AMBER_ESSENCE);
@@ -274,7 +274,7 @@ class npc_ruby_emerald_amber_drake : public CreatureScript
me->SetDisableGravity(false); // Needed this for proper animation after spawn, the summon in air fall to ground bug leave no other option for now, if this isn't used the drake will only walk on move.
}
- void PassengerBoarded(Unit* passenger, int8 seatId, bool apply)
+ void PassengerBoarded(Unit* passenger, int8 /*seatId*/, bool apply) OVERRIDE
{
if (passenger->GetTypeId() != TYPEID_PLAYER)
return;