Merge pull request #5918 from GyxTom/master

Core/Misc: Various cleanups
This commit is contained in:
Shocker
2012-03-28 18:00:42 -07:00
86 changed files with 653 additions and 547 deletions
+3 -1
View File
@@ -73,7 +73,9 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
void SmartAI::UpdateDespawn(const uint32 diff)
{
if (mDespawnState <= 1 || mDespawnState > 3) return;
if (mDespawnState <= 1 || mDespawnState > 3)
return;
if (mDespawnTime < diff)
{
if (mDespawnState == 2)
+1 -1
View File
@@ -245,7 +245,7 @@ public:
SmartScript* GetScript() { return &mScript; }
static int Permissible(const GameObject* g);
bool GossipHello(Player* player) ;
bool GossipHello(Player* player);
bool GossipSelect(Player* player, uint32 sender, uint32 action);
bool GossipSelectCode(Player* /*player*/, uint32 /*sender*/, uint32 /*action*/, const char* /*code*/);
bool QuestAccept(Player* player, Quest const* quest);
@@ -1954,7 +1954,8 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e)
}
case SMARTAI_TEMPLATE_CAGED_NPC_PART:
{
if (!me) return;
if (!me)
return;
//store cage as id1
AddEvent(SMART_EVENT_DATA_SET, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_GAMEOBJECT, e.action.installTtemplate.param1, 10, 0, 0);
@@ -1976,7 +1977,8 @@ void SmartScript::InstallTemplate(SmartScriptHolder const& e)
}
case SMARTAI_TEMPLATE_CAGED_GO_PART:
{
if (!go) return;
if (!go)
return;
//store hostage as id1
AddEvent(SMART_EVENT_GOSSIP_HELLO, 0, 0, 0, 0, 0, SMART_ACTION_STORE_TARGET_LIST, 1, 0, 0, 0, 0, 0, SMART_TARGET_CLOSEST_CREATURE, e.action.installTtemplate.param1, 10, 0, 0);
//store invoker as id2
@@ -2839,8 +2841,12 @@ void SmartScript::InstallEvents()
bool SmartScript::ConditionValid(Unit* u, int32 c, int32 v1, int32 v2, int32 v3)
{
if (c == 0) return true;
if (!u || !u->ToPlayer()) return false;
if (c == 0)
return true;
if (!u || !u->ToPlayer())
return false;
Condition cond;
cond.ConditionType = ConditionTypes(uint32(c));
cond.ConditionValue1 = uint32(v1);
@@ -3007,7 +3013,9 @@ void SmartScript::OnMoveInLineOfSight(Unit* who)
{
ProcessEventsFor(SMART_EVENT_OOC_LOS, who);
if (!me) return;
if (!me)
return;
if (me->getVictim())
return;
@@ -337,8 +337,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
if (e.GetScriptType() == SMART_SCRIPT_TYPE_TIMED_ACTIONLIST)
{
e.event.type = SMART_EVENT_UPDATE_OOC;//force default OOC, can change when calling the script!
if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) return false;
if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) return false;
if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max))
return false;
if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax))
return false;
}
else
{
@@ -356,8 +359,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
case SMART_EVENT_DAMAGED:
case SMART_EVENT_DAMAGED_TARGET:
case SMART_EVENT_RECEIVE_HEAL:
if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max)) return false;
if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax)) return false;
if (!IsMinMaxValid(e, e.event.minMaxRepeat.min, e.event.minMaxRepeat.max))
return false;
if (!IsMinMaxValid(e, e.event.minMaxRepeat.repeatMin, e.event.minMaxRepeat.repeatMax))
return false;
break;
case SMART_EVENT_SPELLHIT:
case SMART_EVENT_SPELLHIT_TARGET:
@@ -375,11 +381,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
return false;
}
}
if (!IsMinMaxValid(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax)) return false;
if (!IsMinMaxValid(e, e.event.spellHit.cooldownMin, e.event.spellHit.cooldownMax))
return false;
break;
case SMART_EVENT_OOC_LOS:
case SMART_EVENT_IC_LOS:
if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax)) return false;
if (!IsMinMaxValid(e, e.event.los.cooldownMin, e.event.los.cooldownMax))
return false;
break;
case SMART_EVENT_RESPAWN:
if (e.event.respawn.type == SMART_SCRIPT_RESPAWN_CONDITION_MAP && !sMapStore.LookupEntry(e.event.respawn.map))
@@ -394,32 +402,48 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
case SMART_EVENT_FRIENDLY_HEALTH:
if (!NotNULL(e, e.event.friendlyHealt.radius)) return false;
if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax)) return false;
if (!NotNULL(e, e.event.friendlyHealt.radius))
return false;
if (!IsMinMaxValid(e, e.event.friendlyHealt.repeatMin, e.event.friendlyHealt.repeatMax))
return false;
break;
case SMART_EVENT_FRIENDLY_IS_CC:
if (!IsMinMaxValid(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax)) return false;
if (!IsMinMaxValid(e, e.event.friendlyCC.repeatMin, e.event.friendlyCC.repeatMax))
return false;
break;
case SMART_EVENT_FRIENDLY_MISSING_BUFF:
{
if (!IsSpellValid(e, e.event.missingBuff.spell)) return false;
if (!NotNULL(e, e.event.missingBuff.radius)) return false;
if (!IsMinMaxValid(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax)) return false;
if (!IsSpellValid(e, e.event.missingBuff.spell))
return false;
if (!NotNULL(e, e.event.missingBuff.radius))
return false;
if (!IsMinMaxValid(e, e.event.missingBuff.repeatMin, e.event.missingBuff.repeatMax))
return false;
break;
}
case SMART_EVENT_KILL:
if (!IsMinMaxValid(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax)) return false;
if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature)) return false;
if (!IsMinMaxValid(e, e.event.kill.cooldownMin, e.event.kill.cooldownMax))
return false;
if (e.event.kill.creature && !IsCreatureValid(e, e.event.kill.creature))
return false;
break;
case SMART_EVENT_TARGET_CASTING:
case SMART_EVENT_PASSENGER_BOARDED:
case SMART_EVENT_PASSENGER_REMOVED:
if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax)) return false;
if (!IsMinMaxValid(e, e.event.minMax.repeatMin, e.event.minMax.repeatMax))
return false;
break;
case SMART_EVENT_SUMMON_DESPAWNED:
case SMART_EVENT_SUMMONED_UNIT:
if (e.event.summoned.creature && !IsCreatureValid(e, e.event.summoned.creature)) return false;
if (!IsMinMaxValid(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax)) return false;
if (e.event.summoned.creature && !IsCreatureValid(e, e.event.summoned.creature))
return false;
if (!IsMinMaxValid(e, e.event.summoned.cooldownMin, e.event.summoned.cooldownMax))
return false;
break;
case SMART_EVENT_ACCEPTED_QUEST:
case SMART_EVENT_REWARD_QUEST:
@@ -428,20 +452,27 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
case SMART_EVENT_RECEIVE_EMOTE:
{
if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote)) return false;
if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax)) return false;
if (e.event.emote.emote && !IsTextEmoteValid(e, e.event.emote.emote))
return false;
if (!IsMinMaxValid(e, e.event.emote.cooldownMin, e.event.emote.cooldownMax))
return false;
break;
}
case SMART_EVENT_HAS_AURA:
case SMART_EVENT_TARGET_BUFFED:
{
if (!IsSpellValid(e, e.event.aura.spell)) return false;
if (!IsMinMaxValid(e, e.event.aura.repeatMin, e.event.aura.repeatMax)) return false;
if (!IsSpellValid(e, e.event.aura.spell))
return false;
if (!IsMinMaxValid(e, e.event.aura.repeatMin, e.event.aura.repeatMax))
return false;
break;
}
case SMART_EVENT_TRANSPORT_ADDCREATURE:
{
if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature)) return false;
if (e.event.transportAddCreature.creature && !IsCreatureValid(e, e.event.transportAddCreature.creature))
return false;
break;
}
case SMART_EVENT_MOVEMENTINFORM:
@@ -455,12 +486,14 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
case SMART_EVENT_DATA_SET:
{
if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax)) return false;
if (!IsMinMaxValid(e, e.event.dataSet.cooldownMin, e.event.dataSet.cooldownMax))
return false;
break;
}
case SMART_EVENT_AREATRIGGER_ONTRIGGER:
{
if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id)) return false;
if (e.event.areatrigger.id && !IsAreaTriggerValid(e, e.event.areatrigger.id))
return false;
break;
}
case SMART_EVENT_TEXT_OVER:
@@ -476,8 +509,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_EVENT_DUMMY_EFFECT:
if (!IsSpellValid(e, e.event.dummy.spell)) return false;
if (e.event.dummy.effIndex > EFFECT_2) return false;
if (!IsSpellValid(e, e.event.dummy.spell))
return false;
if (e.event.dummy.effIndex > EFFECT_2)
return false;
break;
case SMART_EVENT_IS_BEHIND_TARGET:
if (!IsMinMaxValid(e, e.event.behindTarget.cooldownMin, e.event.behindTarget.cooldownMax))
@@ -574,11 +610,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
case SMART_ACTION_SET_EMOTE_STATE:
case SMART_ACTION_PLAY_EMOTE:
if (!IsEmoteValid(e, e.action.emote.emote)) return false;
if (!IsEmoteValid(e, e.action.emote.emote))
return false;
break;
case SMART_ACTION_FAIL_QUEST:
case SMART_ACTION_ADD_QUEST:
if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest)) return false;
if (!e.action.quest.quest || !IsQuestValid(e, e.action.quest.quest))
return false;
break;
case SMART_ACTION_ACTIVATE_TAXI:
{
@@ -590,17 +628,29 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_ACTION_RANDOM_EMOTE:
if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1)) return false;
if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2)) return false;
if (e.action.randomEmote.emote3 && !IsEmoteValid(e, e.action.randomEmote.emote3)) return false;
if (e.action.randomEmote.emote4 && !IsEmoteValid(e, e.action.randomEmote.emote4)) return false;
if (e.action.randomEmote.emote5 && !IsEmoteValid(e, e.action.randomEmote.emote5)) return false;
if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6)) return false;
if (e.action.randomEmote.emote1 && !IsEmoteValid(e, e.action.randomEmote.emote1))
return false;
if (e.action.randomEmote.emote2 && !IsEmoteValid(e, e.action.randomEmote.emote2))
return false;
if (e.action.randomEmote.emote3 && !IsEmoteValid(e, e.action.randomEmote.emote3))
return false;
if (e.action.randomEmote.emote4 && !IsEmoteValid(e, e.action.randomEmote.emote4))
return false;
if (e.action.randomEmote.emote5 && !IsEmoteValid(e, e.action.randomEmote.emote5))
return false;
if (e.action.randomEmote.emote6 && !IsEmoteValid(e, e.action.randomEmote.emote6))
return false;
break;
case SMART_ACTION_ADD_AURA:
case SMART_ACTION_CAST:
case SMART_ACTION_INVOKER_CAST:
if (!IsSpellValid(e, e.action.cast.spell)) return false;
if (!IsSpellValid(e, e.action.cast.spell))
return false;
break;
case SMART_ACTION_CALL_AREAEXPLOREDOREVENTHAPPENS:
case SMART_ACTION_CALL_GROUPEVENTHAPPENS:
@@ -619,8 +669,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
case SMART_ACTION_SEND_CASTCREATUREORGO:
if (!IsQuestValid(e, e.action.castCreatureOrGO.quest)) return false;
if (!IsSpellValid(e, e.action.castCreatureOrGO.spell)) return false;
if (!IsQuestValid(e, e.action.castCreatureOrGO.quest))
return false;
if (!IsSpellValid(e, e.action.castCreatureOrGO.spell))
return false;
break;
@@ -644,11 +697,15 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
case SMART_ACTION_CALL_CASTEDCREATUREORGO:
if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature)) return false;
if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell)) return false;
if (!IsCreatureValid(e, e.action.castedCreatureOrGO.creature))
return false;
if (!IsSpellValid(e, e.action.castedCreatureOrGO.spell))
return false;
break;
case SMART_ACTION_REMOVEAURASFROMSPELL:
if (!IsSpellValid(e, e.action.removeAura.spell)) return false;
if (!IsSpellValid(e, e.action.removeAura.spell))
return false;
break;
case SMART_ACTION_RANDOM_PHASE:
{
@@ -672,11 +729,13 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u attempts to set invalid phase, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType());
return false;
}
if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax)) return false;
if (!IsMinMaxValid(e, e.action.randomPhaseRange.phaseMin, e.action.randomPhaseRange.phaseMax))
return false;
break;
}
case SMART_ACTION_SUMMON_CREATURE:
if (!IsCreatureValid(e, e.action.summonCreature.creature)) return false;
if (!IsCreatureValid(e, e.action.summonCreature.creature))
return false;
if (e.action.summonCreature.type < TEMPSUMMON_TIMED_OR_DEAD_DESPAWN || e.action.summonCreature.type > TEMPSUMMON_MANUAL_DESPAWN)
{
sLog->outErrorDb("SmartAIMgr: Entry %d SourceType %u Event %u Action %u uses incorrect TempSummonType %u, skipped.", e.entryOrGuid, e.GetScriptType(), e.event_id, e.GetActionType(), e.action.summonCreature.type);
@@ -684,10 +743,12 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
case SMART_ACTION_CALL_KILLEDMONSTER:
if (!IsCreatureValid(e, e.action.killedMonster.creature)) return false;
if (!IsCreatureValid(e, e.action.killedMonster.creature))
return false;
break;
case SMART_ACTION_UPDATE_TEMPLATE:
if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature)) return false;
if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature))
return false;
break;
case SMART_ACTION_SET_SHEATH:
if (e.action.setSheath.sheath && e.action.setSheath.sheath >= MAX_SHEATH_STATE)
@@ -706,12 +767,16 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_ACTION_SUMMON_GO:
if (!IsGameObjectValid(e, e.action.summonGO.entry)) return false;
if (!IsGameObjectValid(e, e.action.summonGO.entry))
return false;
break;
case SMART_ACTION_ADD_ITEM:
case SMART_ACTION_REMOVE_ITEM:
if (!IsItemValid(e, e.action.item.entry)) return false;
if (!NotNULL(e, e.action.item.count)) return false;
if (!IsItemValid(e, e.action.item.entry))
return false;
if (!NotNULL(e, e.action.item.count))
return false;
break;
case SMART_ACTION_TELEPORT:
if (!sMapStore.LookupEntry(e.action.teleport.mapID))
@@ -728,7 +793,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
break;
case SMART_ACTION_WP_STOP:
if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest)) return false;
if (e.action.wpStop.quest && !IsQuestValid(e, e.action.wpStop.quest))
return false;
break;
case SMART_ACTION_WP_START:
{
@@ -737,7 +803,8 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses non-existent WaypointPath id %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.pathID);
return false;
}
if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest)) return false;
if (e.action.wpStart.quest && !IsQuestValid(e, e.action.wpStart.quest))
return false;
if (e.action.wpStart.reactState > REACT_AGGRESSIVE)
{
sLog->outErrorDb("SmartAIMgr: Creature %d Event %u Action %u uses invalid React State %u, skipped.", e.entryOrGuid, e.event_id, e.GetActionType(), e.action.wpStart.reactState);
@@ -747,8 +814,11 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
}
case SMART_ACTION_CREATE_TIMED_EVENT:
{
if (!IsMinMaxValid(e, e.action.timeEvent.min, e.action.timeEvent.max)) return false;
if (!IsMinMaxValid(e, e.action.timeEvent.repeatMin, e.action.timeEvent.repeatMax)) return false;
if (!IsMinMaxValid(e, e.action.timeEvent.min, e.action.timeEvent.max))
return false;
if (!IsMinMaxValid(e, e.action.timeEvent.repeatMin, e.action.timeEvent.repeatMax))
return false;
break;
}
case SMART_ACTION_FOLLOW:
@@ -21,7 +21,6 @@
#include "ArenaTeamMgr.h"
#include "World.h"
#include "WorldPacket.h"
#include "ArenaTeam.h"
#include "Battleground.h"
#include "BattlegroundMgr.h"
@@ -259,9 +258,7 @@ void Battleground::Update(uint32 diff)
{
case STATUS_WAIT_JOIN:
if (GetPlayersSize())
{
_ProcessJoin(diff);
}
break;
case STATUS_IN_PROGRESS:
_ProcessOfflineQueue();
@@ -549,7 +549,7 @@ void BattlegroundAB::EventPlayerClickedOnFlag(Player* source, GameObject* /*targ
bool BattlegroundAB::SetupBattleground()
{
for (int i = 0 ; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
for (int i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
if (!AddObject(BG_AB_OBJECT_BANNER_NEUTRAL + 8*i, BG_AB_OBJECTID_NODE_BANNER_0 + i, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
|| !AddObject(BG_AB_OBJECT_BANNER_CONT_A + 8*i, BG_AB_OBJECTID_BANNER_CONT_A, BG_AB_NodePositions[i][0], BG_AB_NodePositions[i][1], BG_AB_NodePositions[i][2], BG_AB_NodePositions[i][3], 0, 0, sin(BG_AB_NodePositions[i][3]/2), cos(BG_AB_NodePositions[i][3]/2), RESPAWN_ONE_DAY)
@@ -1208,7 +1208,7 @@ bool BattlegroundAV::SetupBattleground()
}
//spawn node-objects
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION ; i < BG_AV_NODES_MAX; ++i)
for (uint8 i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
{
if (i <= BG_AV_NODES_FROSTWOLF_HUT)
{
@@ -1293,7 +1293,7 @@ bool BattlegroundAV::SetupBattleground()
return false;
}
}
for (uint16 i= 0 ; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++)
for (uint16 i= 0; i <= (BG_AV_OBJECT_MINE_SUPPLY_S_MAX-BG_AV_OBJECT_MINE_SUPPLY_S_MIN); i++)
{
if (!AddObject(BG_AV_OBJECT_MINE_SUPPLY_S_MIN+i, BG_AV_OBJECTID_MINE_S, BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][0], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][1], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][2], BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3], 0, 0, sin(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), cos(BG_AV_ObjectPos[AV_OPLACE_MINE_SUPPLY_S_MIN+i][3]/2), RESPAWN_ONE_DAY))
{
@@ -1324,30 +1324,39 @@ bool BattlegroundAV::SetupBattleground()
// Initial Nodes
for (i = 0; i < BG_AV_OBJECT_MAX; i++)
SpawnBGObject(i, RESPAWN_ONE_DAY);
for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE ; i++){
for (i = BG_AV_OBJECT_FLAG_A_FIRSTAID_STATION; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_GRAVE; i++)
{
SpawnBGObject(BG_AV_OBJECT_AURA_A_FIRSTAID_STATION+3*i, RESPAWN_IMMEDIATELY);
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
}
for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER ; i++)
for (i = BG_AV_OBJECT_FLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_FLAG_A_STONEHEART_BUNKER; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER ; i++){
for (i = BG_AV_OBJECT_FLAG_H_ICEBLOOD_GRAVE; i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_WTOWER; i++)
{
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
if (i <= BG_AV_OBJECT_FLAG_H_FROSTWOLF_HUT)
SpawnBGObject(BG_AV_OBJECT_AURA_H_FIRSTAID_STATION+3*GetNodeThroughObject(i), RESPAWN_IMMEDIATELY);
}
for (i = BG_AV_OBJECT_TFLAG_A_DUNBALDAR_SOUTH; i <= BG_AV_OBJECT_TFLAG_A_STONEHEART_BUNKER; i+=2)
{
SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag
SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura
}
for (i = BG_AV_OBJECT_TFLAG_H_ICEBLOOD_TOWER; i <= BG_AV_OBJECT_TFLAG_H_FROSTWOLF_WTOWER; i+=2)
{
SpawnBGObject(i, RESPAWN_IMMEDIATELY); //flag
SpawnBGObject(i+16, RESPAWN_IMMEDIATELY); //aura
}
//snowfall and the doors
for (i = BG_AV_OBJECT_FLAG_N_SNOWFALL_GRAVE; i <= BG_AV_OBJECT_DOOR_A; i++)
SpawnBGObject(i, RESPAWN_IMMEDIATELY);
SpawnBGObject(BG_AV_OBJECT_AURA_N_SNOWFALL_GRAVE, RESPAWN_IMMEDIATELY);
//creatures
@@ -1472,7 +1481,7 @@ void BattlegroundAV::ResetBGSubclass()
{
for (uint8 j=0; j<9; j++)
m_Team_QuestStatus[i][j]=0;
m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS;
m_Team_Scores[i]=BG_AV_SCORE_INITIAL_POINTS;
m_IsInformedNearVictory[i]=false;
m_CaptainAlive[i] = true;
m_CaptainBuffTimer[i] = 120000 + urand(0, 4)* 60; //as far as i could see, the buff is randomly so i make 2minutes (thats the duration of the buff itself) + 0-4minutes TODO get the right times
@@ -1493,7 +1502,6 @@ void BattlegroundAV::ResetBGSubclass()
for (uint16 i = 0; i < AV_CPLACE_MAX+AV_STATICCPLACE_MAX; i++)
if (BgCreatures[i])
DelCreature(i);
}
bool BattlegroundAV::IsBothMinesControlledByTeam(uint32 team) const
@@ -1553,4 +1561,4 @@ bool BattlegroundAV::IsAllTowersControlledAndCaptainAlive(uint32 team) const
}
return false;
}
}
@@ -359,7 +359,7 @@ void BattlegroundIC::FillInitialWorldStates(WorldPacket& data)
data << uint32(uws) << uint32(1);
}
for (uint8 i = 0 ; i < MAX_NODE_TYPES ; i++)
for (uint8 i = 0; i < MAX_NODE_TYPES; i++)
data << uint32(nodePoint[i].worldStates[nodePoint[i].nodeState]) << uint32(1);
}
+13 -13
View File
@@ -17,10 +17,8 @@
*/
#include "Common.h"
#include "DatabaseEnv.h"
#include "World.h"
#include "Player.h"
#include "Opcodes.h"
#include "Chat.h"
#include "ObjectAccessor.h"
#include "Language.h"
@@ -54,31 +52,31 @@ bool ChatHandler::HandleCommandsCommand(const char* /*args*/)
bool ChatHandler::HandleStartCommand(const char* /*args*/)
{
Player* chr = m_session->GetPlayer();
Player* player = m_session->GetPlayer();
if (chr->isInFlight())
if (player->isInFlight())
{
SendSysMessage(LANG_YOU_IN_FLIGHT);
SetSentErrorMessage(true);
return false;
}
if (chr->isInCombat())
if (player->isInCombat())
{
SendSysMessage(LANG_YOU_IN_COMBAT);
SetSentErrorMessage(true);
return false;
}
if (chr->isDead() || chr->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
if (player->isDead() || player->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_GHOST))
{
// if player is dead and stuck, send ghost to graveyard
chr->RepopAtGraveyard();
player->RepopAtGraveyard();
return true;
}
// cast spell Stuck
chr->CastSpell(chr, 7355, false);
player->CastSpell(player, 7355, false);
return true;
}
@@ -107,23 +105,25 @@ bool ChatHandler::HandleServerInfoCommand(const char* /*args*/)
bool ChatHandler::HandleDismountCommand(const char* /*args*/)
{
Player* player = m_session->GetPlayer();
//If player is not mounted, so go out :)
if (!m_session->GetPlayer()->IsMounted())
if (!player->IsMounted())
{
SendSysMessage(LANG_CHAR_NON_MOUNTED);
SetSentErrorMessage(true);
return false;
}
if (m_session->GetPlayer()->isInFlight())
if (player->isInFlight())
{
SendSysMessage(LANG_YOU_IN_FLIGHT);
SetSentErrorMessage(true);
return false;
}
m_session->GetPlayer()->Dismount();
m_session->GetPlayer()->RemoveAurasByType(SPELL_AURA_MOUNTED);
player->Dismount();
player->RemoveAurasByType(SPELL_AURA_MOUNTED);
return true;
}
@@ -144,7 +144,7 @@ bool ChatHandler::HandleSaveCommand(const char* /*args*/)
// save if the player has last been saved over 20 seconds ago
uint32 save_interval = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
if (save_interval == 0 || (save_interval > 20*IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20*IN_MILLISECONDS))
if (save_interval == 0 || (save_interval > 20 * IN_MILLISECONDS && player->GetSaveTimer() <= save_interval - 20 * IN_MILLISECONDS))
player->SaveToDB();
return true;
+4 -2
View File
@@ -4764,9 +4764,11 @@ bool ChatHandler::HandleBindSightCommand(const char * /*args*/)
bool ChatHandler::HandleUnbindSightCommand(const char * /*args*/)
{
if (m_session->GetPlayer()->isPossessing())
Player* player = m_session->GetPlayer();
if (player->isPossessing())
return false;
m_session->GetPlayer()->StopCastingBindSight();
player->StopCastingBindSight();
return true;
}
+4 -2
View File
@@ -338,7 +338,9 @@ struct VendorItemData
VendorItem* GetItem(uint32 slot) const
{
if (slot >= m_items.size()) return NULL;
if (slot >= m_items.size())
return NULL;
return m_items[slot];
}
bool Empty() const { return m_items.empty(); }
@@ -373,7 +375,7 @@ struct TrainerSpell
{
TrainerSpell() : spell(0), spellCost(0), reqSkill(0), reqSkillValue(0), reqLevel(0)
{
for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
learnedSpell[i] = 0;
}
@@ -134,7 +134,7 @@ void FormationMgr::LoadCreatureFormations()
CreatureGroupMap[memberGUID] = group_member;
++count;
}
while (result->NextRow()) ;
while (result->NextRow());
sLog->outString(">> Loaded %u creatures in formations in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
@@ -840,7 +840,9 @@ bool GameObject::IsTransport() const
{
// If something is marked as a transport, don't transmit an out of range packet for it.
GameObjectTemplate const* gInfo = GetGOInfo();
if (!gInfo) return false;
if (!gInfo)
return false;
return gInfo->type == GAMEOBJECT_TYPE_TRANSPORT || gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT;
}
@@ -849,7 +851,9 @@ bool GameObject::IsDynTransport() const
{
// If something is marked as a transport, don't transmit an out of range packet for it.
GameObjectTemplate const* gInfo = GetGOInfo();
if (!gInfo) return false;
if (!gInfo)
return false;
return gInfo->type == GAMEOBJECT_TYPE_MO_TRANSPORT || (gInfo->type == GAMEOBJECT_TYPE_TRANSPORT && !gInfo->transport.pause);
}
@@ -730,7 +730,9 @@ class GameObject : public WorldObject, public GridObject<GameObject>
bool IsInSkillupList(uint32 PlayerGuidLow) const
{
for (std::list<uint32>::const_iterator i = m_SkillupList.begin(); i != m_SkillupList.end(); ++i)
if (*i == PlayerGuidLow) return true;
if (*i == PlayerGuidLow)
return true;
return false;
}
void ClearSkillupList() { m_SkillupList.clear(); }
@@ -102,7 +102,8 @@ uint32 GetItemEnchantMod(int32 entry)
{
fCount += ench_iter->chance;
if (fCount > dRoll) return ench_iter->ench;
if (fCount > dRoll)
return ench_iter->ench;
}
//we could get here only if sum of all enchantment chances is lower than 100%
@@ -113,7 +114,8 @@ uint32 GetItemEnchantMod(int32 entry)
{
fCount += ench_iter->chance;
if (fCount > dRoll) return ench_iter->ench;
if (fCount > dRoll)
return ench_iter->ench;
}
return 0;
+3 -1
View File
@@ -1457,7 +1457,9 @@ void Position::GetPositionOffsetTo(const Position & endPos, Position & retOffset
float Position::GetAngle(const Position* obj) const
{
if (!obj) return 0;
if (!obj)
return 0;
return GetAngle(obj->GetPositionX(), obj->GetPositionY());
}
+3 -1
View File
@@ -227,7 +227,9 @@ class Object
bool HasFlag(uint16 index, uint32 flag) const
{
if (index >= m_valuesCount && !PrintIndexError(index, false)) return false;
if (index >= m_valuesCount && !PrintIndexError(index, false))
return false;
return (m_uint32Values[index] & flag) != 0;
}
+1 -1
View File
@@ -1308,7 +1308,7 @@ void Pet::_SaveAuras(SQLTransaction& trans)
stmt->setUInt32(0, m_charmInfo->GetPetNumber());
trans->Append(stmt);
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr)
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr)
{
// check if the aura has to be saved
if (!itr->second->CanBeSaved() || IsPetAura(itr->second))
+6 -5
View File
@@ -4691,7 +4691,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
return TRAINER_SPELL_RED;
bool hasSpell = true;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!trainer_spell->learnedSpell[i])
continue;
@@ -4714,7 +4714,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
if (getLevel() < trainer_spell->reqLevel)
return TRAINER_SPELL_RED;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!trainer_spell->learnedSpell[i])
continue;
@@ -4741,7 +4741,7 @@ TrainerSpellState Player::GetTrainerSpellState(TrainerSpell const* trainer_spell
// check primary prof. limit
// first rank of primary profession spell when there are no proffesions avalible is disabled
for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!trainer_spell->learnedSpell[i])
continue;
@@ -18988,7 +18988,7 @@ void Player::_SaveAuras(SQLTransaction& trans)
stmt->setUInt32(0, GetGUIDLow());
trans->Append(stmt);
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end() ; ++itr)
for (AuraMap::const_iterator itr = m_ownedAuras.begin(); itr != m_ownedAuras.end(); ++itr)
{
if (!itr->second->CanBeSaved())
continue;
@@ -23257,7 +23257,8 @@ void Player::SendCorpseReclaimDelay(bool load)
else
delay = GetCorpseReclaimDelay(pvp);
if (!delay) return;
if (!delay)
return;
//! corpse reclaim delay 30 * 1000ms or longer at often deaths
WorldPacket data(SMSG_CORPSE_RECLAIM_DELAY, 4);
+1 -1
View File
@@ -1511,7 +1511,7 @@ class Player : public Unit, public GridObject<Player>
static uint32 GetLevelFromDB(uint64 guid);
static bool LoadPositionFromDB(uint32& mapid, float& x, float& y, float& z, float& o, bool& in_flight, uint64 guid);
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE ; }
static bool IsValidGender(uint8 Gender) { return Gender <= GENDER_FEMALE; }
/*********************************************************/
/*** SAVE SYSTEM ***/
+15 -8
View File
@@ -457,7 +457,8 @@ void Unit::resetAttackTimer(WeaponAttackType type)
bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
{
if (!obj || !IsInMap(obj)) return false;
if (!obj || !IsInMap(obj))
return false;
float dx = GetPositionX() - obj->GetPositionX();
float dy = GetPositionY() - obj->GetPositionY();
@@ -472,7 +473,8 @@ bool Unit::IsWithinCombatRange(const Unit* obj, float dist2compare) const
bool Unit::IsWithinMeleeRange(const Unit* obj, float dist) const
{
if (!obj || !IsInMap(obj)) return false;
if (!obj || !IsInMap(obj))
return false;
float dx = GetPositionX() - obj->GetPositionX();
float dy = GetPositionY() - obj->GetPositionY();
@@ -2878,7 +2880,8 @@ void Unit::SetCurrentCastedSpell(Spell* pSpell)
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
if (pSpell == m_currentSpells[CSpellType]) return; // avoid breaking self
if (pSpell == m_currentSpells[CSpellType]) // avoid breaking self
return;
// break same type spell if it is not delayed
InterruptSpell(CSpellType, false);
@@ -3245,7 +3248,7 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
aura->HandleAuraSpecificMods(aurApp, caster, true, false);
// apply effects of the aura
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (effMask & 1<<i && (!aurApp->GetRemoveMode()))
aurApp->_HandleEffect(i, true);
@@ -3304,7 +3307,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
aura->_UnapplyForTarget(this, caster, aurApp);
// remove effects of the spell - needs to be done after removing aura from lists
for (uint8 itr = 0 ; itr < MAX_SPELL_EFFECTS; ++itr)
for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr)
{
if (aurApp->HasEffect(itr))
aurApp->_HandleEffect(itr, false);
@@ -3481,7 +3484,7 @@ void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode)
if (aurApp->GetRemoveMode())
{
// remove remaining effects of an aura
for (uint8 itr = 0 ; itr < MAX_SPELL_EFFECTS; ++itr)
for (uint8 itr = 0; itr < MAX_SPELL_EFFECTS; ++itr)
{
if (aurApp->HasEffect(itr))
aurApp->_HandleEffect(itr, false);
@@ -4619,7 +4622,9 @@ GameObject* Unit::GetGameObject(uint32 spellId) const
void Unit::AddGameObject(GameObject* gameObj)
{
if (!gameObj || !gameObj->GetOwnerGUID() == 0) return;
if (!gameObj || !gameObj->GetOwnerGUID() == 0)
return;
m_gameObj.push_back(gameObj);
gameObj->SetOwnerGUID(GetGUID());
@@ -11879,7 +11884,9 @@ float Unit::GetWeaponProcChance() const
float Unit::GetPPMProcChance(uint32 WeaponSpeed, float PPM, const SpellInfo* spellProto) const
{
// proc per minute chance calculation
if (PPM <= 0) return 0.0f;
if (PPM <= 0)
return 0.0f;
// Apply chance modifer aura
if (spellProto)
if (Player* modOwner = GetSpellModOwner())
+2 -2
View File
@@ -1336,7 +1336,7 @@ class Unit : public WorldObject
float GetStat(Stats stat) const { return float(GetUInt32Value(UNIT_FIELD_STAT0+stat)); }
void SetStat(Stats stat, int32 val) { SetStatInt32Value(UNIT_FIELD_STAT0+stat, val); }
uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL) ; }
uint32 GetArmor() const { return GetResistance(SPELL_SCHOOL_NORMAL); }
void SetArmor(int32 val) { SetResistance(SPELL_SCHOOL_NORMAL, val); }
uint32 GetResistance(SpellSchools school) const { return GetUInt32Value(UNIT_FIELD_RESISTANCES+school); }
@@ -2026,7 +2026,7 @@ class Unit : public WorldObject
float GetAPMultiplier(WeaponAttackType attType, bool normalized);
void ModifyAuraState(AuraStateType flag, bool apply);
uint32 BuildAuraStateUpdateForTarget(Unit* target) const;
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const ;
bool HasAuraState(AuraStateType flag, SpellInfo const* spellProto = NULL, Unit const* Caster = NULL) const;
void UnsummonAllTotems();
Unit* GetMagicHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo);
Unit* GetMeleeHitRedirectTarget(Unit* victim, SpellInfo const* spellInfo = NULL);
+1 -1
View File
@@ -80,7 +80,7 @@ uint32 GameEventMgr::NextCheck(uint16 entry) const
if (mGameEvent[entry].state == GAMEEVENT_WORLD_CONDITIONS)
{
if (mGameEvent[entry].length)
return mGameEvent[entry].length * 60 ;
return mGameEvent[entry].length * 60;
else
return max_ge_check_delay;
}
+8 -4
View File
@@ -8598,10 +8598,13 @@ uint32 ObjectMgr::GetScriptId(const char *name)
{
// use binary search to find the script name in the sorted vector
// assume "" is the first element
if (!name) return 0;
ScriptNameContainer::const_iterator itr =
std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name);
if (itr == _scriptNamesStore.end() || *itr != name) return 0;
if (!name)
return 0;
ScriptNameContainer::const_iterator itr = std::lower_bound(_scriptNamesStore.begin(), _scriptNamesStore.end(), name);
if (itr == _scriptNamesStore.end() || *itr != name)
return 0;
return uint32(itr - _scriptNamesStore.begin());
}
@@ -8610,6 +8613,7 @@ void ObjectMgr::CheckScripts(ScriptsType type, std::set<int32>& ids)
ScriptMapMap* scripts = GetScriptsMapByType(type);
if (!scripts)
return;
for (ScriptMapMap::const_iterator itrMM = scripts->begin(); itrMM != scripts->end(); ++itrMM)
{
for (ScriptMap::const_iterator itrM = itrMM->second.begin(); itrM != itrMM->second.end(); ++itrM)
+1 -1
View File
@@ -1230,7 +1230,7 @@ void Guild::HandleQuery(WorldSession* session)
data << uint32(m_id);
data << m_name;
for (uint8 i = 0 ; i < GUILD_RANKS_MAX_COUNT; ++i) // Alwayse show 10 ranks
for (uint8 i = 0; i < GUILD_RANKS_MAX_COUNT; ++i) // Alwayse show 10 ranks
{
if (i < _GetRanksSize())
data << m_ranks[i].GetName();
+3 -2
View File
@@ -248,8 +248,9 @@ void WorldSession::HandleGroupDeclineOpcode(WorldPacket & /*recv_data*/)
{
sLog->outDebug(LOG_FILTER_NETWORKIO, "WORLD: Received CMSG_GROUP_DECLINE");
Group *group = GetPlayer()->GetGroupInvite();
if (!group) return;
Group* group = GetPlayer()->GetGroupInvite();
if (!group)
return;
// Remember leader if online (group pointer will be invalid if group gets disbanded)
Player* leader = ObjectAccessor::FindPlayer(group->GetLeaderGUID());
+1 -1
View File
@@ -115,7 +115,7 @@ void WorldSession::HandleSwapItem(WorldPacket & recv_data)
//sLog->outDebug(LOG_FILTER_PACKETIO, "WORLD: CMSG_SWAP_ITEM");
uint8 dstbag, dstslot, srcbag, srcslot;
recv_data >> dstbag >> dstslot >> srcbag >> srcslot ;
recv_data >> dstbag >> dstslot >> srcbag >> srcslot;
//sLog->outDebug("STORAGE: receive srcbag = %u, srcslot = %u, dstbag = %u, dstslot = %u", srcbag, srcslot, dstbag, dstslot);
uint16 src = ((srcbag << 8) | srcslot);
+1 -1
View File
@@ -70,7 +70,7 @@ void WorldSession::HandleLfgJoinOpcode(WorldPacket& recv_data)
}
LfgDungeonSet newDungeons;
for (int8 i = 0 ; i < numDungeons; ++i)
for (int8 i = 0; i < numDungeons; ++i)
{
recv_data >> dungeon;
newDungeons.insert((dungeon & 0x00FFFFFF)); // remove the type from the dungeon entry
+2 -2
View File
@@ -169,7 +169,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
bool valid = true;
bool primary_prof_first_rank = false;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!tSpell->learnedSpell[i])
continue;
@@ -199,7 +199,7 @@ void WorldSession::SendTrainerList(uint64 guid, const std::string& strTitle)
data << uint32(tSpell->reqSkillValue);
//prev + req or req + 0
uint8 maxReq = 0;
for (uint8 i = 0; i < MAX_SPELL_EFFECTS ; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (!tSpell->learnedSpell[i])
continue;
+11 -9
View File
@@ -512,7 +512,9 @@ QuestItemList* Loot::FillFFALoot(Player* player)
QuestItemList* Loot::FillQuestLoot(Player* player)
{
if (items.size() == MAX_NR_LOOT_ITEMS) return NULL;
if (items.size() == MAX_NR_LOOT_ITEMS)
return NULL;
QuestItemList* ql = new QuestItemList();
for (uint8 i = 0; i < quest_items.size(); ++i)
@@ -734,7 +736,7 @@ bool Loot::hasItemFor(Player* player) const
if (q_itr != lootPlayerQuestItems.end())
{
QuestItemList* q_list = q_itr->second;
for (QuestItemList::const_iterator qi = q_list->begin() ; qi != q_list->end(); ++qi)
for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
{
const LootItem &item = quest_items[qi->index];
if (!qi->is_looted && !item.is_looted)
@@ -747,7 +749,7 @@ bool Loot::hasItemFor(Player* player) const
if (ffa_itr != lootPlayerFFAItems.end())
{
QuestItemList* ffa_list = ffa_itr->second;
for (QuestItemList::const_iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi)
for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
{
const LootItem &item = items[fi->index];
if (!fi->is_looted && !item.is_looted)
@@ -760,7 +762,7 @@ bool Loot::hasItemFor(Player* player) const
if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
QuestItemList* conditional_list = nn_itr->second;
for (QuestItemList::const_iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci)
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
{
const LootItem &item = items[ci->index];
if (!ci->is_looted && !item.is_looted)
@@ -900,7 +902,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
if (q_itr != lootPlayerQuestItems.end())
{
QuestItemList* q_list = q_itr->second;
for (QuestItemList::const_iterator qi = q_list->begin() ; qi != q_list->end(); ++qi)
for (QuestItemList::const_iterator qi = q_list->begin(); qi != q_list->end(); ++qi)
{
LootItem &item = l.quest_items[qi->index];
if (!qi->is_looted && !item.is_looted)
@@ -918,7 +920,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
if (ffa_itr != lootPlayerFFAItems.end())
{
QuestItemList* ffa_list = ffa_itr->second;
for (QuestItemList::const_iterator fi = ffa_list->begin() ; fi != ffa_list->end(); ++fi)
for (QuestItemList::const_iterator fi = ffa_list->begin(); fi != ffa_list->end(); ++fi)
{
LootItem &item = l.items[fi->index];
if (!fi->is_looted && !item.is_looted)
@@ -936,7 +938,7 @@ ByteBuffer& operator<<(ByteBuffer& b, LootView const& lv)
if (nn_itr != lootPlayerNonQuestNonFFAConditionalItems.end())
{
QuestItemList* conditional_list = nn_itr->second;
for (QuestItemList::const_iterator ci = conditional_list->begin() ; ci != conditional_list->end(); ++ci)
for (QuestItemList::const_iterator ci = conditional_list->begin(); ci != conditional_list->end(); ++ci)
{
LootItem &item = l.items[ci->index];
if (!ci->is_looted && !item.is_looted)
@@ -1285,7 +1287,7 @@ bool LootTemplate::HasQuestDrop(LootTemplateMap const& store, uint8 groupId) con
}
// Now processing groups
for (LootGroups::const_iterator i = Groups.begin() ; i != Groups.end(); ++i)
for (LootGroups::const_iterator i = Groups.begin(); i != Groups.end(); ++i)
if (i->HasQuestDrop())
return true;
@@ -1303,7 +1305,7 @@ bool LootTemplate::HasQuestDropForPlayer(LootTemplateMap const& store, Player co
}
// Checking non-grouped entries
for (LootStoreItemList::const_iterator i = Entries.begin() ; i != Entries.end(); ++i)
for (LootStoreItemList::const_iterator i = Entries.begin(); i != Entries.end(); ++i)
{
if (i->mincountOrRef < 0) // References processing
{
+6 -2
View File
@@ -245,8 +245,12 @@ class Map : public GridRefManager<NGridType>
// currently unused for normal maps
bool CanUnload(uint32 diff)
{
if (!m_unloadTimer) return false;
if (m_unloadTimer <= diff) return true;
if (!m_unloadTimer)
return false;
if (m_unloadTimer <= diff)
return true;
m_unloadTimer -= diff;
return false;
}
+36 -36
View File
@@ -350,7 +350,7 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
void Aura::_InitEffects(uint8 effMask, Unit* caster, int32 *baseAmount)
{
// shouldn't be in constructor - functions in AuraEffect::AuraEffect use polymorphism
for (uint8 i=0 ; i<MAX_SPELL_EFFECTS; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
{
if (effMask & (uint8(1) << i))
m_effects[i] = new AuraEffect(this, i, baseAmount ? baseAmount + i : NULL, caster);
@@ -371,7 +371,7 @@ Aura::~Aura()
}
// free effects memory
for (uint8 i = 0 ; i < MAX_SPELL_EFFECTS; ++i)
for (uint8 i = 0; i < MAX_SPELL_EFFECTS; ++i)
delete m_effects[i];
ASSERT(m_applications.empty());
@@ -2043,7 +2043,7 @@ void Aura::_DeleteRemovedApplications()
void Aura::LoadScripts()
{
sScriptMgr->CreateAuraScripts(m_spellInfo->Id, m_loadedScripts);
for (std::list<AuraScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
for (std::list<AuraScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();)
{
if (!(*itr)->_Load(this))
{
@@ -2060,11 +2060,11 @@ void Aura::LoadScripts()
bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_CHECK_AREA_TARGET);
std::list<AuraScript::CheckAreaTargetHandler>::iterator hookItrEnd = (*scritr)->DoCheckAreaTarget.end(), hookItr = (*scritr)->DoCheckAreaTarget.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
if (!(*hookItr).Call(*scritr, target))
return false;
(*scritr)->_FinishScriptCall();
@@ -2074,11 +2074,11 @@ bool Aura::CallScriptCheckAreaTargetHandlers(Unit* target)
void Aura::CallScriptDispel(DispelInfo* dispelInfo)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_DISPEL);
std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->OnDispel.end(), hookItr = (*scritr)->OnDispel.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr, dispelInfo);
(*scritr)->_FinishScriptCall();
}
@@ -2086,11 +2086,11 @@ void Aura::CallScriptDispel(DispelInfo* dispelInfo)
void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_AFTER_DISPEL);
std::list<AuraScript::AuraDispelHandler>::iterator hookItrEnd = (*scritr)->AfterDispel.end(), hookItr = (*scritr)->AfterDispel.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr, dispelInfo);
(*scritr)->_FinishScriptCall();
}
@@ -2099,11 +2099,11 @@ void Aura::CallScriptAfterDispel(DispelInfo* dispelInfo)
bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
bool preventDefault = false;
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_APPLY, aurApp);
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectApply.end(), effItr = (*scritr)->OnEffectApply.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, mode);
@@ -2118,11 +2118,11 @@ bool Aura::CallScriptEffectApplyHandlers(AuraEffect const* aurEff, AuraApplicati
bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
bool preventDefault = false;
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_REMOVE, aurApp);
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->OnEffectRemove.end(), effItr = (*scritr)->OnEffectRemove.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, mode);
@@ -2136,11 +2136,11 @@ bool Aura::CallScriptEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplicat
void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_APPLY, aurApp);
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectApply.end(), effItr = (*scritr)->AfterEffectApply.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, mode);
@@ -2151,11 +2151,11 @@ void Aura::CallScriptAfterEffectApplyHandlers(AuraEffect const* aurEff, AuraAppl
void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp, AuraEffectHandleModes mode)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_REMOVE, aurApp);
std::list<AuraScript::EffectApplyHandler>::iterator effEndItr = (*scritr)->AfterEffectRemove.end(), effItr = (*scritr)->AfterEffectRemove.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, mode);
@@ -2167,11 +2167,11 @@ void Aura::CallScriptAfterEffectRemoveHandlers(AuraEffect const* aurEff, AuraApp
bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplication const* aurApp)
{
bool preventDefault = false;
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_PERIODIC, aurApp);
std::list<AuraScript::EffectPeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectPeriodic.end(), effItr = (*scritr)->OnEffectPeriodic.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff);
@@ -2185,11 +2185,11 @@ bool Aura::CallScriptEffectPeriodicHandlers(AuraEffect const* aurEff, AuraApplic
void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_UPDATE_PERIODIC);
std::list<AuraScript::EffectUpdatePeriodicHandler>::iterator effEndItr = (*scritr)->OnEffectUpdatePeriodic.end(), effItr = (*scritr)->OnEffectUpdatePeriodic.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff);
@@ -2200,11 +2200,11 @@ void Aura::CallScriptEffectUpdatePeriodicHandlers(AuraEffect* aurEff)
void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 & amount, bool & canBeRecalculated)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_AMOUNT);
std::list<AuraScript::EffectCalcAmountHandler>::iterator effEndItr = (*scritr)->DoEffectCalcAmount.end(), effItr = (*scritr)->DoEffectCalcAmount.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, amount, canBeRecalculated);
@@ -2215,11 +2215,11 @@ void Aura::CallScriptEffectCalcAmountHandlers(AuraEffect const* aurEff, int32 &
void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool & isPeriodic, int32 & amplitude)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_PERIODIC);
std::list<AuraScript::EffectCalcPeriodicHandler>::iterator effEndItr = (*scritr)->DoEffectCalcPeriodic.end(), effItr = (*scritr)->DoEffectCalcPeriodic.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, isPeriodic, amplitude);
@@ -2230,11 +2230,11 @@ void Aura::CallScriptEffectCalcPeriodicHandlers(AuraEffect const* aurEff, bool &
void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellModifier* & spellMod)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_CALC_SPELLMOD);
std::list<AuraScript::EffectCalcSpellModHandler>::iterator effEndItr = (*scritr)->DoEffectCalcSpellMod.end(), effItr = (*scritr)->DoEffectCalcSpellMod.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, spellMod);
@@ -2245,11 +2245,11 @@ void Aura::CallScriptEffectCalcSpellModHandlers(AuraEffect const* aurEff, SpellM
void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_ABSORB, aurApp);
std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->OnEffectAbsorb.end(), effItr = (*scritr)->OnEffectAbsorb.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2260,11 +2260,11 @@ void Aura::CallScriptEffectAbsorbHandlers(AuraEffect* aurEff, AuraApplication co
void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_ABSORB, aurApp);
std::list<AuraScript::EffectAbsorbHandler>::iterator effEndItr = (*scritr)->AfterEffectAbsorb.end(), effItr = (*scritr)->AfterEffectAbsorb.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2275,11 +2275,11 @@ void Aura::CallScriptEffectAfterAbsorbHandlers(AuraEffect* aurEff, AuraApplicati
void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount, bool & /*defaultPrevented*/)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_MANASHIELD, aurApp);
std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->OnEffectManaShield.end(), effItr = (*scritr)->OnEffectManaShield.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2290,11 +2290,11 @@ void Aura::CallScriptEffectManaShieldHandlers(AuraEffect* aurEff, AuraApplicatio
void Aura::CallScriptEffectAfterManaShieldHandlers(AuraEffect* aurEff, AuraApplication const* aurApp, DamageInfo & dmgInfo, uint32 & absorbAmount)
{
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<AuraScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(AURA_SCRIPT_HOOK_EFFECT_AFTER_MANASHIELD, aurApp);
std::list<AuraScript::EffectManaShieldHandler>::iterator effEndItr = (*scritr)->AfterEffectManaShield.end(), effItr = (*scritr)->AfterEffectManaShield.begin();
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
{
if ((*effItr).IsEffectAffected(m_spellInfo, aurEff->GetEffIndex()))
(*effItr).Call(*scritr, aurEff, dmgInfo, absorbAmount);
@@ -2339,7 +2339,7 @@ void UnitAura::Remove(AuraRemoveMode removeMode)
void UnitAura::FillTargetMap(std::map<Unit*, uint8> & targets, Unit* caster)
{
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS ; ++effIndex)
for (uint8 effIndex = 0; effIndex < MAX_SPELL_EFFECTS; ++effIndex)
{
if (!HasEffect(effIndex))
continue;
+30 -26
View File
@@ -1274,7 +1274,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
break;
// Remove targets outside caster's raid
for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();)
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
{
if (!(*itr)->IsInRaidWith(m_caster))
itr = unitTargets.erase(itr);
@@ -1291,7 +1291,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
else if (m_spellInfo->SpellFamilyFlags[2] == 0x0100) // Starfall
{
// Remove targets not in LoS or in stealth
for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();)
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
{
if ((*itr)->HasStealthAura() || (*itr)->HasInvisibilityAura() || !(*itr)->IsWithinLOSInMap(m_caster))
itr = unitTargets.erase(itr);
@@ -1304,7 +1304,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
break;
// Remove targets outside caster's raid
for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();)
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
if (!(*itr)->IsInRaidWith(m_caster))
itr = unitTargets.erase(itr);
else
@@ -1326,7 +1326,7 @@ void Spell::SelectImplicitAreaTargets(SpellEffIndex effIndex, SpellImplicitTarge
}
else
{
for (std::list<Unit*>::iterator itr = unitTargets.begin() ; itr != unitTargets.end();)
for (std::list<Unit*>::iterator itr = unitTargets.begin(); itr != unitTargets.end();)
if ((*itr)->getPowerType() != (Powers)power)
itr = unitTargets.erase(itr);
else
@@ -6039,7 +6039,7 @@ SpellCastResult Spell::CheckItems()
// check totem-item requirements (items presence in inventory)
uint32 totems = 2;
for (int i = 0; i < 2 ; ++i)
for (int i = 0; i < 2; ++i)
{
if (m_spellInfo->Totem[i] != 0)
{
@@ -6262,9 +6262,12 @@ SpellCastResult Spell::CheckItems()
case SPELL_EFFECT_WEAPON_DAMAGE:
case SPELL_EFFECT_WEAPON_DAMAGE_NOSCHOOL:
{
if (m_caster->GetTypeId() != TYPEID_PLAYER) return SPELL_FAILED_TARGET_NOT_PLAYER;
if (m_caster->GetTypeId() != TYPEID_PLAYER)
return SPELL_FAILED_TARGET_NOT_PLAYER;
if (m_attackType != RANGED_ATTACK)
break;
Item* pItem = m_caster->ToPlayer()->GetWeaponForAttack(m_attackType);
if (!pItem || pItem->IsBroken())
return SPELL_FAILED_EQUIPPED_ITEM;
@@ -6276,7 +6279,8 @@ SpellCastResult Spell::CheckItems()
uint32 ammo = pItem->GetEntry();
if (!m_caster->ToPlayer()->HasItemCount(ammo, 1))
return SPELL_FAILED_NO_AMMO;
}; break;
};
break;
case ITEM_SUBCLASS_WEAPON_GUN:
case ITEM_SUBCLASS_WEAPON_BOW:
case ITEM_SUBCLASS_WEAPON_CROSSBOW:
@@ -6987,7 +6991,7 @@ void Spell::CheckEffectExecuteData()
void Spell::LoadScripts()
{
sScriptMgr->CreateSpellScripts(m_spellInfo->Id, m_loadedScripts);
for (std::list<SpellScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end() ;)
for (std::list<SpellScript*>::iterator itr = m_loadedScripts.begin(); itr != m_loadedScripts.end();)
{
if (!(*itr)->_Load(this))
{
@@ -7004,11 +7008,11 @@ void Spell::LoadScripts()
void Spell::CallScriptBeforeCastHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_CAST);
std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->BeforeCast.end(), hookItr = (*scritr)->BeforeCast.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
(*scritr)->_FinishScriptCall();
@@ -7017,11 +7021,11 @@ void Spell::CallScriptBeforeCastHandlers()
void Spell::CallScriptOnCastHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_ON_CAST);
std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->OnCast.end(), hookItr = (*scritr)->OnCast.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
(*scritr)->_FinishScriptCall();
@@ -7030,11 +7034,11 @@ void Spell::CallScriptOnCastHandlers()
void Spell::CallScriptAfterCastHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_CAST);
std::list<SpellScript::CastHandler>::iterator hookItrEnd = (*scritr)->AfterCast.end(), hookItr = (*scritr)->AfterCast.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
(*scritr)->_FinishScriptCall();
@@ -7044,7 +7048,7 @@ void Spell::CallScriptAfterCastHandlers()
SpellCastResult Spell::CallScriptCheckCastHandlers()
{
SpellCastResult retVal = SPELL_CAST_OK;
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_CHECK_CAST);
std::list<SpellScript::CheckCastHandler>::iterator hookItrEnd = (*scritr)->OnCheckCast.end(), hookItr = (*scritr)->OnCheckCast.begin();
@@ -7062,7 +7066,7 @@ SpellCastResult Spell::CallScriptCheckCastHandlers()
void Spell::PrepareScriptHitHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
(*scritr)->_InitHit();
}
@@ -7070,7 +7074,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo
{
// execute script effect handler hooks and check if effects was prevented
bool preventDefault = false;
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
std::list<SpellScript::EffectHandler>::iterator effItr, effEndItr;
SpellScriptHookType hookType;
@@ -7101,7 +7105,7 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo
return false;
}
(*scritr)->_PrepareScriptCall(hookType);
for (; effItr != effEndItr ; ++effItr)
for (; effItr != effEndItr; ++effItr)
// effect execution can be prevented
if (!(*scritr)->_IsEffectPrevented(effIndex) && (*effItr).IsEffectAffected(m_spellInfo, effIndex))
(*effItr).Call(*scritr, effIndex);
@@ -7116,11 +7120,11 @@ bool Spell::CallScriptEffectHandlers(SpellEffIndex effIndex, SpellEffectHandleMo
void Spell::CallScriptBeforeHitHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_BEFORE_HIT);
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->BeforeHit.end(), hookItr = (*scritr)->BeforeHit.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
(*scritr)->_FinishScriptCall();
@@ -7129,11 +7133,11 @@ void Spell::CallScriptBeforeHitHandlers()
void Spell::CallScriptOnHitHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_HIT);
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->OnHit.end(), hookItr = (*scritr)->OnHit.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
(*scritr)->_FinishScriptCall();
@@ -7142,11 +7146,11 @@ void Spell::CallScriptOnHitHandlers()
void Spell::CallScriptAfterHitHandlers()
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_AFTER_HIT);
std::list<SpellScript::HitHandler>::iterator hookItrEnd = (*scritr)->AfterHit.end(), hookItr = (*scritr)->AfterHit.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
(*hookItr).Call(*scritr);
(*scritr)->_FinishScriptCall();
@@ -7155,11 +7159,11 @@ void Spell::CallScriptAfterHitHandlers()
void Spell::CallScriptAfterUnitTargetSelectHandlers(std::list<Unit*>& unitTargets, SpellEffIndex effIndex)
{
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end() ; ++scritr)
for (std::list<SpellScript*>::iterator scritr = m_loadedScripts.begin(); scritr != m_loadedScripts.end(); ++scritr)
{
(*scritr)->_PrepareScriptCall(SPELL_SCRIPT_HOOK_UNIT_TARGET_SELECT);
std::list<SpellScript::UnitTargetHandler>::iterator hookItrEnd = (*scritr)->OnUnitTargetSelect.end(), hookItr = (*scritr)->OnUnitTargetSelect.begin();
for (; hookItr != hookItrEnd ; ++hookItr)
for (; hookItr != hookItrEnd; ++hookItr)
if ((*hookItr).IsEffectAffected(m_spellInfo, effIndex))
(*hookItr).Call(*scritr, unitTargets);
+1 -1
View File
@@ -1992,7 +1992,7 @@ void Spell::EffectEnergize(SpellEffIndex effIndex)
sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_GUARDIAN, avalibleElixirs);
if (!battleFound)
sSpellMgr->GetSetOfSpellsInSpellGroup(SPELL_GROUP_ELIXIR_BATTLE, avalibleElixirs);
for (std::set<uint32>::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end() ;)
for (std::set<uint32>::iterator itr = avalibleElixirs.begin(); itr != avalibleElixirs.end();)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(*itr);
if (spellInfo->SpellLevel < m_spellInfo->SpellLevel || spellInfo->SpellLevel > unitTarget->getLevel())
+42 -58
View File
@@ -643,7 +643,7 @@ SpellSpellGroupMapBounds SpellMgr::GetSpellSpellGroupMapBounds(uint32 spell_id)
uint32 SpellMgr::IsSpellMemberOfSpellGroup(uint32 spellid, SpellGroup groupid) const
{
SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellid);
for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
{
if (itr->second == groupid)
return true;
@@ -669,7 +669,7 @@ void SpellMgr::GetSetOfSpellsInSpellGroup(SpellGroup group_id, std::set<uint32>&
usedGroups.insert(group_id);
SpellGroupSpellMapBounds groupSpell = GetSpellGroupSpellMapBounds(group_id);
for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second ; ++itr)
for (SpellGroupSpellMap::const_iterator itr = groupSpell.first; itr != groupSpell.second; ++itr)
{
if (itr->second < 0)
{
@@ -688,7 +688,7 @@ bool SpellMgr::AddSameEffectStackRuleSpellGroups(SpellInfo const* spellInfo, int
uint32 spellId = spellInfo->GetFirstRankSpell()->Id;
SpellSpellGroupMapBounds spellGroup = GetSpellSpellGroupMapBounds(spellId);
// Find group with SPELL_GROUP_STACK_RULE_EXCLUSIVE_SAME_EFFECT if it belongs to one
for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second ; ++itr)
for (SpellSpellGroupMap::const_iterator itr = spellGroup.first; itr != spellGroup.second; ++itr)
{
SpellGroup group = itr->second;
SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(group);
@@ -724,13 +724,13 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn
// find SpellGroups which are common for both spells
SpellSpellGroupMapBounds spellGroup1 = GetSpellSpellGroupMapBounds(spellid_1);
std::set<SpellGroup> groups;
for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second ; ++itr)
for (SpellSpellGroupMap::const_iterator itr = spellGroup1.first; itr != spellGroup1.second; ++itr)
{
if (IsSpellMemberOfSpellGroup(spellid_2, itr->second))
{
bool add = true;
SpellGroupSpellMapBounds groupSpell = GetSpellGroupSpellMapBounds(itr->second);
for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second ; ++itr2)
for (SpellGroupSpellMap::const_iterator itr2 = groupSpell.first; itr2 != groupSpell.second; ++itr2)
{
if (itr2->second < 0)
{
@@ -749,7 +749,7 @@ SpellGroupStackRule SpellMgr::CheckSpellGroupStackRules(SpellInfo const* spellIn
SpellGroupStackRule rule = SPELL_GROUP_STACK_RULE_DEFAULT;
for (std::set<SpellGroup>::iterator itr = groups.begin() ; itr!= groups.end() ; ++itr)
for (std::set<SpellGroup>::iterator itr = groups.begin(); itr!= groups.end(); ++itr)
{
SpellGroupStackMap::const_iterator found = mSpellGroupStack.find(*itr);
if (found != mSpellGroupStack.end())
@@ -1140,11 +1140,6 @@ bool SpellArea::IsFitToRequirements(Player const* player, uint32 newZone, uint32
return true;
}
void SpellMgr::LoadSpellInfos()
{
}
void SpellMgr::LoadSpellRanks()
{
uint32 oldMSTime = getMSTime();
@@ -1160,13 +1155,12 @@ void SpellMgr::LoadSpellRanks()
if (!result)
{
sLog->outString(">> Loaded 0 spell rank records");
sLog->outString(">> Loaded 0 spell rank records. DB table `spell_ranks` is empty.");
sLog->outString();
sLog->outErrorDb("`spell_ranks` table is empty!");
return;
}
uint32 rows = 0;
uint32 count = 0;
bool finished = false;
do
@@ -1213,7 +1207,7 @@ void SpellMgr::LoadSpellRanks()
int32 curRank = 0;
bool valid = true;
// check spells in chain
for (std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin() ; itr!= rankChain.end(); ++itr)
for (std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin(); itr!= rankChain.end(); ++itr)
{
SpellInfo const* spell = GetSpellInfo(itr->first);
if (!spell)
@@ -1237,7 +1231,7 @@ void SpellMgr::LoadSpellRanks()
std::list<std::pair<int32, int32> >::iterator itr = rankChain.begin();
do
{
++rows;
++count;
int32 addedSpell = itr->first;
mSpellChains[addedSpell].first = GetSpellInfo(lastSpell);
mSpellChains[addedSpell].last = GetSpellInfo(rankChain.back().first);
@@ -1257,7 +1251,7 @@ void SpellMgr::LoadSpellRanks()
while (true);
} while (!finished);
sLog->outString(">> Loaded %u spell rank records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime));
sLog->outString(">> Loaded %u spell rank records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
@@ -1273,19 +1267,19 @@ void SpellMgr::LoadSpellRequired()
if (!result)
{
sLog->outString(">> Loaded 0 spell required records");
sLog->outString(">> Loaded 0 spell required records. DB table `spell_required` is empty.");
sLog->outString();
sLog->outErrorDb("`spell_required` table is empty!");
return;
}
uint32 rows = 0;
uint32 count = 0;
do
{
Field* fields = result->Fetch();
uint32 spell_id = fields[0].GetUInt32();
uint32 spell_req = fields[1].GetUInt32();
// check if chain is made with valid first spell
SpellInfo const* spell = GetSpellInfo(spell_id);
if (!spell)
@@ -1293,17 +1287,20 @@ void SpellMgr::LoadSpellRequired()
sLog->outErrorDb("spell_id %u in `spell_required` table is not found in dbcs, skipped", spell_id);
continue;
}
SpellInfo const* req_spell = GetSpellInfo(spell_req);
if (!req_spell)
{
sLog->outErrorDb("req_spell %u in `spell_required` table is not found in dbcs, skipped", spell_req);
continue;
}
if (GetFirstSpellInChain(spell_id) == GetFirstSpellInChain(spell_req))
{
sLog->outErrorDb("req_spell %u and spell_id %u in `spell_required` table are ranks of the same spell, entry not needed, skipped", spell_req, spell_id);
continue;
}
if (IsSpellRequiringSpell(spell_id, spell_req))
{
sLog->outErrorDb("duplicated entry of req_spell %u and spell_id %u in `spell_required`, skipped", spell_req, spell_id);
@@ -1312,10 +1309,10 @@ void SpellMgr::LoadSpellRequired()
mSpellReq.insert (std::pair<uint32, uint32>(spell_id, spell_req));
mSpellsReqSpell.insert (std::pair<uint32, uint32>(spell_req, spell_id));
++rows;
++count;
} while (result->NextRow());
sLog->outString(">> Loaded %u spell required records in %u ms", rows, GetMSTimeDiffToNow(oldMSTime));
sLog->outString(">> Loaded %u spell required records in %u ms", count, GetMSTimeDiffToNow(oldMSTime));
sLog->outString();
}
@@ -1367,14 +1364,12 @@ void SpellMgr::LoadSpellLearnSpells()
QueryResult result = WorldDatabase.Query("SELECT entry, SpellID, Active FROM spell_learn_spell");
if (!result)
{
sLog->outString(">> Loaded 0 spell learn spells");
sLog->outString(">> Loaded 0 spell learn spells. DB table `spell_learn_spell` is empty.");
sLog->outString();
sLog->outErrorDb("`spell_learn_spell` table is empty!");
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -1382,9 +1377,9 @@ void SpellMgr::LoadSpellLearnSpells()
uint32 spell_id = fields[0].GetUInt16();
SpellLearnSpellNode node;
node.spell = fields[1].GetUInt16();
node.active = fields[2].GetBool();
node.autoLearned= false;
node.spell = fields[1].GetUInt16();
node.active = fields[2].GetBool();
node.autoLearned = false;
if (!GetSpellInfo(spell_id))
{
@@ -1478,7 +1473,6 @@ void SpellMgr::LoadSpellTargetPositions()
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -1590,19 +1584,17 @@ void SpellMgr::LoadSpellGroups()
mSpellSpellGroup.clear(); // need for reload case
mSpellGroupSpell.clear();
uint32 count = 0;
// 0 1
QueryResult result = WorldDatabase.Query("SELECT id, spell_id FROM spell_group");
if (!result)
{
sLog->outString(">> Loaded 0 spell group definitions. DB table `spell_group` is empty.");
sLog->outString();
sLog->outString(">> Loaded %u spell group definitions", count);
return;
}
std::set<uint32> groups;
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -1620,7 +1612,7 @@ void SpellMgr::LoadSpellGroups()
} while (result->NextRow());
for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end() ;)
for (SpellGroupSpellMap::iterator itr = mSpellGroupSpell.begin(); itr!= mSpellGroupSpell.end();)
{
if (itr->second < 0)
{
@@ -1651,12 +1643,12 @@ void SpellMgr::LoadSpellGroups()
}
}
for (std::set<uint32>::iterator groupItr = groups.begin() ; groupItr != groups.end() ; ++groupItr)
for (std::set<uint32>::iterator groupItr = groups.begin(); groupItr != groups.end(); ++groupItr)
{
std::set<uint32> spells;
GetSetOfSpellsInSpellGroup(SpellGroup(*groupItr), spells);
for (std::set<uint32>::iterator spellItr = spells.begin() ; spellItr != spells.end() ; ++spellItr)
for (std::set<uint32>::iterator spellItr = spells.begin(); spellItr != spells.end(); ++spellItr)
{
++count;
mSpellSpellGroup.insert(SpellSpellGroupMap::value_type(*spellItr, SpellGroup(*groupItr)));
@@ -1673,17 +1665,16 @@ void SpellMgr::LoadSpellGroupStackRules()
mSpellGroupStack.clear(); // need for reload case
uint32 count = 0;
// 0 1
QueryResult result = WorldDatabase.Query("SELECT group_id, stack_rule FROM spell_group_stack_rules");
if (!result)
{
sLog->outString(">> Loaded 0 spell group stack rules");
sLog->outString(">> Loaded 0 spell group stack rules. DB table `spell_group_stack_rules` is empty.");
sLog->outString();
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -1719,17 +1710,16 @@ void SpellMgr::LoadSpellProcEvents()
mSpellProcEventMap.clear(); // need for reload case
uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 9 10
QueryResult result = WorldDatabase.Query("SELECT entry, SchoolMask, SpellFamilyName, SpellFamilyMask0, SpellFamilyMask1, SpellFamilyMask2, procFlags, procEx, ppmRate, CustomChance, Cooldown FROM spell_proc_event");
if (!result)
{
sLog->outString(">> Loaded %u spell proc event conditions", count);
sLog->outString(">> Loaded 0 spell proc event conditions. DB table `spell_proc_event` is empty.");
sLog->outString();
return;
}
uint32 count = 0;
uint32 customProc = 0;
do
{
@@ -1784,17 +1774,16 @@ void SpellMgr::LoadSpellProcs()
mSpellProcMap.clear(); // need for reload case
uint32 count = 0;
// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14
QueryResult result = WorldDatabase.Query("SELECT spellId, schoolMask, spellFamilyName, spellFamilyMask0, spellFamilyMask1, spellFamilyMask2, typeMask, spellTypeMask, spellPhaseMask, hitMask, attributesMask, ratePerMinute, chance, cooldown, charges FROM spell_proc");
if (!result)
{
sLog->outString(">> Loaded %u spell proc conditions and data", count);
sLog->outString(">> Loaded 0 spell proc conditions and data. DB table `spell_proc` is empty.");
sLog->outString();
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -1925,16 +1914,17 @@ void SpellMgr::LoadSpellBonusess()
uint32 oldMSTime = getMSTime();
mSpellBonusMap.clear(); // need for reload case
uint32 count = 0;
// 0 1 2 3 4
QueryResult result = WorldDatabase.Query("SELECT entry, direct_bonus, dot_bonus, ap_bonus, ap_dot_bonus FROM spell_bonus_data");
if (!result)
{
sLog->outString(">> Loaded %u spell bonus data", count);
sLog->outString(">> Loaded 0 spell bonus data. DB table `spell_bonus_data` is empty.");
sLog->outString();
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -1966,17 +1956,16 @@ void SpellMgr::LoadSpellThreats()
mSpellThreatMap.clear(); // need for reload case
uint32 count = 0;
// 0 1 2 3
QueryResult result = WorldDatabase.Query("SELECT entry, flatMod, pctMod, apPctMod FROM spell_threat");
if (!result)
{
sLog->outString(">> Loaded 0 aggro generating spells");
sLog->outString(">> Loaded 0 aggro generating spells. DB table `spell_threat` is empty.");
sLog->outString();
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -2040,7 +2029,6 @@ void SpellMgr::LoadSpellPetAuras()
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -2095,11 +2083,10 @@ void SpellMgr::LoadEnchantCustomAttr()
uint32 size = sSpellItemEnchantmentStore.GetNumRows();
mEnchantCustomAttr.resize(size);
uint32 count = 0;
for (uint32 i = 0; i < size; ++i)
mEnchantCustomAttr[i] = 0;
uint32 count = 0;
for (uint32 i = 0; i < GetSpellInfoStoreSize(); ++i)
{
SpellInfo const* spellInfo = GetSpellInfo(i);
@@ -2135,17 +2122,16 @@ void SpellMgr::LoadSpellEnchantProcData()
mSpellEnchantProcEventMap.clear(); // need for reload case
uint32 count = 0;
// 0 1 2 3
QueryResult result = WorldDatabase.Query("SELECT entry, customChance, PPMChance, procEx FROM spell_enchant_proc_data");
if (!result)
{
sLog->outString(">> Loaded %u spell enchant proc event conditions", count);
sLog->outString(">> Loaded 0 spell enchant proc event conditions. DB table `spell_enchant_proc_data` is empty.");
sLog->outString();
return;
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -2190,7 +2176,6 @@ void SpellMgr::LoadSpellLinked()
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
@@ -2435,7 +2420,6 @@ void SpellMgr::LoadSpellAreas()
}
uint32 count = 0;
do
{
Field* fields = result->Fetch();
-1
View File
@@ -693,7 +693,6 @@ class SpellMgr
public:
// Loading data at server startup
void LoadSpellInfos();
void LoadSpellRanks();
void LoadSpellRequired();
void LoadSpellLearnSkills();
+2 -5
View File
@@ -207,6 +207,7 @@ bool World::RemoveSession(uint32 id)
{
if (itr->second->PlayerLoading())
return false;
itr->second->KickPlayer();
}
@@ -218,8 +219,7 @@ void World::AddSession(WorldSession* s)
addSessQueue.add(s);
}
void
World::AddSession_(WorldSession* s)
void World::AddSession_(WorldSession* s)
{
ASSERT (s);
@@ -272,11 +272,8 @@ World::AddSession_(WorldSession* s)
}
s->SendAuthResponse(AUTH_OK, true);
s->SendAddonsInfo();
s->SendClientCacheVersion(sWorld->getIntConfig(CONFIG_CLIENTCACHE_VERSION));
s->SendTutorialsData();
UpdateMaxSessionCounters();
@@ -203,16 +203,16 @@ public:
pAttumen->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NON_ATTACKABLE);
float angle = me->GetAngle(pAttumen);
float distance = me->GetDistance2d(pAttumen);
float newX = me->GetPositionX() + cos(angle)*(distance/2) ;
float newY = me->GetPositionY() + sin(angle)*(distance/2) ;
float newX = me->GetPositionX() + cos(angle)*(distance/2);
float newY = me->GetPositionY() + sin(angle)*(distance/2);
float newZ = 50;
//me->Relocate(newX, newY, newZ, angle);
//me->SendMonsterMove(newX, newY, newZ, 0, true, 1000);
me->GetMotionMaster()->Clear();
me->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
distance += 10;
newX = me->GetPositionX() + cos(angle)*(distance/2) ;
newY = me->GetPositionY() + sin(angle)*(distance/2) ;
newX = me->GetPositionX() + cos(angle)*(distance/2);
newY = me->GetPositionY() + sin(angle)*(distance/2);
pAttumen->GetMotionMaster()->Clear();
pAttumen->GetMotionMaster()->MovePoint(0, newX, newY, newZ);
//pAttumen->Relocate(newX, newY, newZ, -angle);
@@ -201,7 +201,7 @@ public:
void DeSpawnAdds()
{
for (uint8 i = 0; i < 4 ; ++i)
for (uint8 i = 0; i < 4; ++i)
{
Creature* Temp = NULL;
if (AddGUID[i])
@@ -277,9 +277,7 @@ public:
void JustSummoned(Creature* summoned)
{
if (Player* player = GetPlayerForEscort())
{
summoned->AI()->AttackStart(player);
}
if (summoned->GetEntry() == NPC_HIGH_INQUISITOR_VALROTH)
m_uiValrothGUID = summoned->GetGUID();
@@ -1011,8 +1011,7 @@ public:
if (fLichPositionX && fLichPositionY)
{
Unit* temp;
temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
Unit* temp = me->SummonCreature(NPC_DEFENDER_OF_THE_LIGHT, LightofDawnLoc[0].x+rand()%10, LightofDawnLoc[0].y+rand()%10, LightofDawnLoc[0].z, 0, TEMPSUMMON_TIMED_OR_CORPSE_DESPAWN, 10000);
temp->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_STATE_ATTACK_UNARMED);
temp->SetWalk(false);
temp->SetSpeed(MOVE_RUN, 2.0f);
@@ -301,7 +301,7 @@ class boss_hexlord_malacrass : public CreatureScript
me->MonsterYell(YELL_DEATH, LANG_UNIVERSAL, 0);
DoPlaySoundToSet(me, SOUND_YELL_DEATH);
for (uint8 i = 0; i < 4 ; ++i)
for (uint8 i = 0; i < 4; ++i)
{
Unit* Temp = Unit::GetUnit((*me), AddGUID[i]);
if (Temp && Temp->isAlive())
@@ -198,7 +198,7 @@ class boss_venoxis : public CreatureScript
case EVENT_HOLY_NOVA:
_inMeleeRange = 0;
for (uint8 i = 0; i < 10 ; ++i)
for (uint8 i = 0; i < 10; ++i)
{
if (Unit* target = SelectTarget(SELECT_TARGET_TOPAGGRO, i))
// check if target is within melee-distance
@@ -99,8 +99,7 @@ class npc_professor_phizzlethorpe : public CreatureScript
case 20:
Talk(EMOTE_PROGRESS_8);
Talk(SAY_PROGRESS_9, player->GetGUID());
if (player)
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
CAST_PLR(player)->GroupEventHappens(QUEST_SUNKEN_TREASURE, me);
break;
}
}
@@ -139,52 +139,61 @@ public:
switch (i)
{
case 0:
{
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, me, player);
break;
}
case 5:
DoScriptText(SAY_PROGRESS1, me, player);
case 11:
DoScriptText(SAY_PROGRESS2, me, player);
me->SetOrientation(4.762841f);
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, me, player);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
Summ2->Attack(player, true);
}
me->AI()->AttackStart(Summ1);
break;
}
case 19: me->SetWalk(false);
break;
case 25: me->SetWalk(true);
break;
case 30:
if (player && player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
me->SetOrientation(2.978281f);
DoScriptText(SAY_END1, me, player);
break;
case 33:
me->SetOrientation(5.858011f);
DoScriptText(SAY_END2, me, player);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player);
break;
case 0:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
DoScriptText(SAY_START, me, player);
break;
case 5:
DoScriptText(SAY_PROGRESS1, me, player);
break;
case 11:
DoScriptText(SAY_PROGRESS2, me, player);
me->SetOrientation(4.762841f);
break;
case 18:
{
DoScriptText(SAY_PROGRESS3, me, player);
Creature* Summ1 = me->SummonCreature(16342, 7627.083984f, -7532.538086f, 152.128616f, 1.082733f, TEMPSUMMON_DEAD_DESPAWN, 0);
Creature* Summ2 = me->SummonCreature(16343, 7620.432129f, -7532.550293f, 152.454865f, 0.827478f, TEMPSUMMON_DEAD_DESPAWN, 0);
if (Summ1 && Summ2)
{
Summ1->Attack(me, true);
Summ2->Attack(player, true);
}
me->AI()->AttackStart(Summ1);
}
break;
case 19:
me->SetWalk(false);
break;
case 25:
me->SetWalk(true);
break;
case 30:
if (player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_ESCAPE_FROM_THE_CATACOMBS, me);
break;
case 32:
me->SetOrientation(2.978281f);
DoScriptText(SAY_END1, me, player);
break;
case 33:
me->SetOrientation(5.858011f);
DoScriptText(SAY_END2, me, player);
Unit* CaptainHelios = me->FindNearestCreature(NPC_CAPTAIN_HELIOS, 50);
if (CaptainHelios)
DoScriptText(SAY_CAPTAIN_ANSWER, CaptainHelios, player);
break;
}
}
@@ -314,7 +314,7 @@ public:
{
m_uiPostEventTimer = 3000;
if (Unit* player = GetPlayerForEscort())
if (Player* player = GetPlayerForEscort())
{
switch (m_uiPostEventCount)
{
@@ -75,25 +75,44 @@ public:
switch (i)
{
case 1: DoScriptText(SAY_START, me, player);break;
case 13:
DoScriptText(SAY_LAST, me, player);
player->GroupEventHappens(QUEST_ESCORTING, me); break;
case 14: DoScriptText(SAY_THANKS, me, player); break;
case 15: {
Unit* Rane = me->FindNearestCreature(NPC_RANE, 20);
if (Rane)
case 1:
DoScriptText(SAY_START, me, player);
break;
case 13:
DoScriptText(SAY_LAST, me, player);
player->GroupEventHappens(QUEST_ESCORTING, me);
break;
case 14:
DoScriptText(SAY_THANKS, me, player);
break;
case 15:
if (Unit* Rane = me->FindNearestCreature(NPC_RANE, 20))
DoScriptText(SAY_RANE, Rane);
break;}
case 16: DoScriptText(SAY_ANSWER, me); break;
case 17: DoScriptText(SAY_MOVE_QUINN, me); break;
case 24: DoScriptText(SAY_GREETINGS, me); break;
case 25: {
Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20);
if (Quinn)
break;
case 16:
DoScriptText(SAY_ANSWER, me);
break;
case 17:
DoScriptText(SAY_MOVE_QUINN, me);
break;
case 24:
DoScriptText(SAY_GREETINGS, me);
break;
case 25:
if (Unit* Quinn = me->FindNearestCreature(NPC_QUINN, 20))
DoScriptText(SAY_QUINN, Quinn);
break;}
case 26: DoScriptText(SAY_ON_BYE, me, NULL); break;
break;
case 26:
DoScriptText(SAY_ON_BYE, me, NULL);
break;
}
}
@@ -85,6 +85,7 @@ public:
{
if (creature->isQuestGiver())
player->PrepareQuestMenu(creature->GetGUID());
if (creature->isVendor())
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_VENDOR, GOSSIP_TEXT_BROWSE_GOODS, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_TRADE);
@@ -95,7 +96,8 @@ public:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA3, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+3);
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HDA4, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+4);
player->SEND_GOSSIP_MENU(3985, creature->GetGUID());
}else
}
else
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
@@ -378,8 +380,7 @@ public:
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_TOMB_LIGHTBRINGER);
}
@@ -243,13 +243,11 @@ public:
break;
case 44:
DoScriptText(SAY_END, me, player);
{
if (player)
player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me);
}
player->GroupEventHappens(QUEST_DEFIAS_BROTHERHOOD, me);
break;
}
}
void EnterCombat(Unit* who)
{
DoScriptText(RAND(SAY_AGGRO_1, SAY_AGGRO_2), me, who);
@@ -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);
}
@@ -52,7 +52,7 @@ class npc_henry_stern : public CreatureScript
public:
npc_henry_stern() : CreatureScript("npc_henry_stern") { }
bool OnGossipSelect (Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
bool OnGossipSelect(Player* player, Creature* creature, uint32 /*sender*/, uint32 action)
{
player->PlayerTalkClass->ClearMenus();
if (action == GOSSIP_ACTION_INFO_DEF + 1)
@@ -70,7 +70,7 @@ public:
return true;
}
bool OnGossipHello (Player* player, Creature* creature)
bool OnGossipHello(Player* player, Creature* creature)
{
if (player->GetBaseSkillValue(SKILL_COOKING) >= 175 && !player->HasSpell(SPELL_GOLDTHORN_TEA))
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_TEA, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 1);
@@ -81,7 +81,6 @@ public:
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*######
@@ -115,7 +115,7 @@ public:
case 45:
DoScriptText(SAY_WIN, me, player);
me->SetFlag(UNIT_NPC_FLAGS, UNIT_NPC_FLAG_QUESTGIVER);
if (player && player->GetTypeId() == TYPEID_PLAYER)
if (player->GetTypeId() == TYPEID_PLAYER)
CAST_PLR(player)->GroupEventHappens(QUEST_WILLIX_THE_IMPORTER, me);
break;
case 46:
@@ -399,9 +399,9 @@ public:
enum
{
ZOMBIE = 7286,
DEAD_HERO = 7276,
ZOMBIE_CHANCE = 65,
ZOMBIE = 7286,
DEAD_HERO = 7276,
ZOMBIE_CHANCE = 65,
DEAD_HERO_CHANCE = 10
};
@@ -419,13 +419,12 @@ public:
if (randomchance < ZOMBIE_CHANCE)
go->SummonCreature(ZOMBIE, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
else
if ((randomchance-ZOMBIE_CHANCE) < DEAD_HERO_CHANCE)
if ((randomchance - ZOMBIE_CHANCE) < DEAD_HERO_CHANCE)
go->SummonCreature(DEAD_HERO, go->GetPositionX(), go->GetPositionY(), go->GetPositionZ(), 0, TEMPSUMMON_CORPSE_TIMED_DESPAWN, 30000);
}
go->AddUse();
return false;
}
};
/*######
+17 -33
View File
@@ -100,8 +100,7 @@ class npc_torek : public CreatureScript
case 20:
DoScriptText(SAY_WIN, me, player);
Completed = true;
if (player)
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
player->GroupEventHappens(QUEST_TOREK_ASSULT, me);
break;
case 21:
Talk(SAY_END, player->GetGUID());
@@ -177,47 +176,41 @@ class npc_torek : public CreatureScript
class npc_ruul_snowhoof : public CreatureScript
{
public:
npc_ruul_snowhoof()
: CreatureScript("npc_ruul_snowhoof")
{
}
npc_ruul_snowhoof() : CreatureScript("npc_ruul_snowhoof") { }
struct npc_ruul_snowhoofAI : public npc_escortAI
{
npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) {}
npc_ruul_snowhoofAI(Creature* creature) : npc_escortAI(creature) { }
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 0: {
case 0:
me->SetUInt32Value(UNIT_FIELD_BYTES_1, 0);
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20);
if (Cage)
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 20))
Cage->SetGoState(GO_STATE_ACTIVE);
break;}
case 13:
break;
case 13:
me->SummonCreature(3922, 3449.218018f, -587.825073f, 174.978867f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3446.384521f, -587.830872f, 175.186279f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3444.218994f, -587.835327f, 175.380600f, 4.714445f, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 19:
case 19:
me->SummonCreature(3922, 3508.344482f, -492.024261f, 186.929031f, 4.145029f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3921, 3506.265625f, -490.531006f, 186.740128f, 4.239277f, TEMPSUMMON_DEAD_DESPAWN, 60000);
me->SummonCreature(3926, 3503.682373f, -489.393799f, 186.629684f, 4.349232f, TEMPSUMMON_DEAD_DESPAWN, 60000);
break;
case 21:{
if (player)
player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break; }
case 21:
player->GroupEventHappens(QUEST_FREEDOM_TO_RUUL, me);
break;
}
}
@@ -330,12 +323,10 @@ class npc_muglash : public CreatureScript
switch (i)
{
case 0:
if (player)
DoScriptText(SAY_MUG_START2, me, player);
DoScriptText(SAY_MUG_START2, me, player);
break;
case 24:
if (player)
DoScriptText(SAY_MUG_BRAZIER, me, player);
DoScriptText(SAY_MUG_BRAZIER, me, player);
if (GameObject* go = GetClosestGameObjectWithEntry(me, GO_NAGA_BRAZIER, INTERACTION_DISTANCE*2))
{
@@ -345,9 +336,7 @@ class npc_muglash : public CreatureScript
break;
case 25:
DoScriptText(SAY_MUG_GRATITUDE, me);
if (player)
player->GroupEventHappens(QUEST_VORSHA, me);
player->GroupEventHappens(QUEST_VORSHA, me);
break;
case 26:
DoScriptText(SAY_MUG_PATROL, me);
@@ -378,14 +367,9 @@ class npc_muglash : public CreatureScript
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (player)
{
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_VORSHA);
}
}
}
void DoWaveSummon()
@@ -602,7 +602,7 @@ public:
ravager->AI()->AttackStart(player);
}
}
return true ;
return true;
}
};
+2 -3
View File
@@ -238,7 +238,7 @@ public:
break;
case 15:
if (player)
player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
player->GroupEventHappens(QUEST_RETURN_TO_VAHLARRIEL, me);
break;
}
}
@@ -249,8 +249,7 @@ public:
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_RETURN_TO_VAHLARRIEL);
return;
}
@@ -641,9 +641,9 @@ public:
DoScriptText(SAY_QUEST_COMPLETE, me, player);
me->SetSpeed(MOVE_RUN, 1.2f, true);
me->SetWalk(false);
if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_H, me);
if (player && player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
player->GroupEventHappens(QUEST_STINKYS_ESCAPE_A, me);
break;
case 39:
@@ -663,10 +663,11 @@ public:
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (HasEscortState(STATE_ESCORT_ESCORTING) && player)
if (player && HasEscortState(STATE_ESCORT_ESCORTING))
{
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_H))
player->FailQuest(QUEST_STINKYS_ESCAPE_H);
if (player->GetQuestStatus(QUEST_STINKYS_ESCAPE_A))
player->FailQuest(QUEST_STINKYS_ESCAPE_A);
}
+1 -3
View File
@@ -154,9 +154,7 @@ public:
DoScriptText(SAY_OOX_END, me);
// Award quest credit
if (Player* player = GetPlayerForEscort())
{
player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
}
player->GroupEventHappens(QUEST_RESCUE_OOX22FE, me);
break;
}
}
@@ -123,17 +123,18 @@ public:
switch (i)
{
case 16:
DoScriptText(SAY_AMBUSH, me);
me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 18: me->SetInFront(player);
DoScriptText(SAY_END, me, player);
if (player)
case 16:
DoScriptText(SAY_AMBUSH, me);
me->SummonCreature(NPC_GRIMTOTEM_BRUTE, -48.53f, -503.34f, -46.31f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_RUFFIAN, -38.85f, -503.77f, -45.90f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
me->SummonCreature(NPC_GRIMTOTEM_SORCERER, -36.37f, -496.23f, -45.71f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 30000);
break;
case 18:
me->SetInFront(player);
DoScriptText(SAY_END, me, player);
player->GroupEventHappens(QUEST_PROTECT_KAYA, me);
break;
break;
}
}
+4 -7
View File
@@ -435,7 +435,8 @@ public:
if (!player)
return;
switch (i) {
switch (i)
{
case 23:
me->SummonCreature(SPAWN_FIRST, -8350.96f, -4445.79f, 10.10f, 6.20f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(SPAWN_FIRST, -8355.96f, -4447.79f, 10.10f, 6.27f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
@@ -453,11 +454,8 @@ public:
break;
case 86:
if (player)
{
DoScriptText(SAY_OOX_END, me);
player->GroupEventHappens(Q_OOX17, me);
}
DoScriptText(SAY_OOX_END, me);
player->GroupEventHappens(Q_OOX17, me);
break;
}
}
@@ -474,7 +472,6 @@ public:
summoned->AI()->AttackStart(me);
}
};
};
/*####
@@ -595,11 +595,6 @@ public:
void WaypointReached(uint32 uiPointId)
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (uiPointId)
{
case 0:
@@ -277,7 +277,6 @@ public:
TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, 60000);
}
};
};
/*#####
@@ -316,6 +315,7 @@ public:
{
if (player->GetQuestStatus(QUEST_SCOOP) == QUEST_STATUS_INCOMPLETE)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_P, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(738, creature->GetGUID());
return true;
@@ -410,7 +410,6 @@ public:
bool OnGossipHello(Player* player, GameObject* go)
{
if (player->GetQuestStatus(5151) == QUEST_STATUS_INCOMPLETE)
{
if (Creature* panther = go->FindNearestCreature(ENRAGED_PANTHER, 5, true))
@@ -421,7 +420,7 @@ public:
}
}
return true ;
return true;
}
};
@@ -104,8 +104,7 @@ public:
break;
case 55:
DoScriptText(SAY_FINISH, me, player);
if (player)
player->GroupEventHappens(QUEST_CHASING_AME, me);
player->GroupEventHappens(QUEST_CHASING_AME, me);
break;
}
}
+2 -2
View File
@@ -161,12 +161,12 @@ public:
{
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_HWDM, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
player->SEND_GOSSIP_MENU(3377, creature->GetGUID());
}else
}
else
player->SEND_GOSSIP_MENU(3375, creature->GetGUID());
return true;
}
};
void AddSC_winterspring()
@@ -105,7 +105,7 @@ class instance_trial_of_the_crusader : public InstanceMapScript
bool IsEncounterInProgress() const
{
for (uint8 i = 0; i < MAX_ENCOUNTERS ; ++i)
for (uint8 i = 0; i < MAX_ENCOUNTERS; ++i)
if (EncounterStatus[i] == IN_PROGRESS)
return true;
return false;
@@ -457,7 +457,7 @@ public:
{
if (HealthBelowPct(45))
{
Phase = 3 ;
Phase = 3;
DoScriptText(SAY_REQUEST_AID, me);
//here Lich King should respond to KelThuzad but I don't know which Creature to make talk
//so for now just make Kelthuzad says it.
@@ -465,7 +465,6 @@ public:
playerDied = buff2;
}
};
};
void AddSC_instance_naxxramas()
@@ -203,7 +203,7 @@ public:
if (!instance || instance->GetData(DATA_UROM_PLATAFORM) > 2)
return;
for (uint8 i = 0; i < 4 ; i++)
for (uint8 i = 0; i < 4; i++)
{
SetPosition(i);
me->SummonCreature(Group[group[instance->GetData(DATA_UROM_PLATAFORM)]].entry[i], x, y, me->GetPositionZ(), me->GetOrientation());
@@ -308,7 +308,7 @@ class spell_varos_energize_core_area_enemy : public SpellScriptLoader
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
for (std::list<Unit*>::iterator itr = targetList.begin() ; itr != targetList.end();)
for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
{
Position pos;
(*itr)->GetPosition(&pos);
@@ -355,7 +355,7 @@ class spell_varos_energize_core_area_entry : public SpellScriptLoader
float orientation = CAST_AI(boss_varos::boss_varosAI, varos->AI())->GetCoreEnergizeOrientation();
for (std::list<Unit*>::iterator itr = targetList.begin() ; itr != targetList.end();)
for (std::list<Unit*>::iterator itr = targetList.begin(); itr != targetList.end();)
{
Position pos;
(*itr)->GetPosition(&pos);
@@ -48,65 +48,77 @@ public:
void Reset()
{
if (fm_Type == 0) fm_Type = GetForgeMasterType();
if (fm_Type == 0)
fm_Type = GetForgeMasterType();
CheckForge();
}
void CheckForge()
{
if (instance)
if (instance)
{
switch (fm_Type)
{
case 1:
instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE);
break;
case 1:
instance->SetData(EVENT_FORGE_1, me->isAlive() ? NOT_STARTED : DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, me->isAlive() ? NOT_STARTED : DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, me->isAlive() ? NOT_STARTED : DONE);
break;
}
}
}
void JustDied(Unit* /*killer*/)
{
if (fm_Type == 0) fm_Type = GetForgeMasterType();
if (fm_Type == 0)
fm_Type = GetForgeMasterType();
if (instance)
{
switch (fm_Type)
{
case 1:
instance->SetData(EVENT_FORGE_1, DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, DONE);
break;
case 1:
instance->SetData(EVENT_FORGE_1, DONE);
break;
case 2:
instance->SetData(EVENT_FORGE_2, DONE);
break;
case 3:
instance->SetData(EVENT_FORGE_3, DONE);
break;
}
}
}
void EnterCombat(Unit* /*who*/)
{
if (fm_Type == 0) fm_Type = GetForgeMasterType();
if (fm_Type == 0)
fm_Type = GetForgeMasterType();
if (instance)
{
switch (fm_Type)
{
case 1:
instance->SetData(EVENT_FORGE_1, IN_PROGRESS);
break;
case 2:
instance->SetData(EVENT_FORGE_2, IN_PROGRESS);
break;
case 3:
instance->SetData(EVENT_FORGE_3, IN_PROGRESS);
break;
case 1:
instance->SetData(EVENT_FORGE_1, IN_PROGRESS);
break;
case 2:
instance->SetData(EVENT_FORGE_2, IN_PROGRESS);
break;
case 3:
instance->SetData(EVENT_FORGE_3, IN_PROGRESS);
break;
}
}
me->SetUInt32Value(UNIT_NPC_EMOTESTATE, EMOTE_ONESHOT_NONE);
@@ -115,29 +127,26 @@ public:
uint8 GetForgeMasterType()
{
float diff = 30.0f;
int near_f = 0;
uint8 near_f = 0;
for (uint8 i = 0; i < 3 ; ++i)
for (uint8 i = 0; i < 3; ++i)
{
GameObject* temp;
temp = me->FindNearestGameObject(entry_search[i], 30);
if (temp)
if (GameObject* go = me->FindNearestGameObject(entry_search[i], 30))
{
if (me->IsWithinDist(temp, diff, false))
if (me->IsWithinDist(go, diff, false))
{
near_f = i + 1;
diff = me->GetDistance2d(temp);
diff = me->GetDistance2d(go);
}
}
}
switch (near_f)
{
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
case 1: return 1;
case 2: return 2;
case 3: return 3;
default: return 0;
}
}
@@ -152,7 +161,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
void AddSC_utgarde_keep()
@@ -1876,8 +1876,7 @@ public:
me->SetPhaseMask(1, true);
DoScriptText(SAY_5, me);
me->HandleEmoteCommand(EMOTE_ONESHOT_EXCLAMATION);
if (player)
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
player->GroupEventHappens(QUEST_ESCAPING_THE_MIST, me);
SetRun(true);
break;
}
@@ -79,6 +79,7 @@ public:
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 9:
@@ -102,6 +102,7 @@ public:
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 1:
@@ -109,8 +110,7 @@ public:
SetRun(true);
break;
case 23:
if (player)
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
player->GroupEventHappens(QUEST_TRAIL_OF_FIRE, me);
me->DespawnOrUnsummon();
break;
case 5:
@@ -113,8 +113,8 @@ public:
if (Player* player = GetPlayerForEscort())
{
if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE)
player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS);
if (player->GetQuestStatus(QUEST_FORTUNATE_MISUNDERSTANDINGS) != QUEST_STATUS_COMPLETE)
player->FailQuest(QUEST_FORTUNATE_MISUNDERSTANDINGS);
}
}
};
@@ -401,12 +401,12 @@ public:
{
m_uiChatTimer = 4000;
}
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_DISASTER);
}
}
+9 -6
View File
@@ -377,15 +377,18 @@ public:
void WaypointReached(uint32 i)
{
Player* player = GetPlayerForEscort();
if (!player)
return;
switch (i)
{
case 26:
DoScriptText(SAY_END_WP_REACHED, me, player);
break;
case 27:
if (player)
case 26:
DoScriptText(SAY_END_WP_REACHED, me, player);
break;
case 27:
player->GroupEventHappens(QUEST_BITTER_DEPARTURE, me);
break;
break;
}
}
+1 -1
View File
@@ -1071,7 +1071,7 @@ public:
SummonList.clear();
for (uint8 uiI = 0; uiI < 16 ; uiI++)
for (uint8 uiI = 0; uiI < 16; uiI++)
{
if (Creature* summon = me->SummonCreature(Boss[uiBossRandom].uiAdd, AddSpawnPosition[uiI]))
{
@@ -236,8 +236,8 @@ class boss_warchief_kargath_bladefist : public CreatureScript
float x, y, randx, randy;
randx = 0.0f + rand()%40;
randy = 0.0f + rand()%40;
x = 210+ randx ;
y = -60- randy ;
x = 210+ randx;
y = -60- randy;
me->GetMotionMaster()->MovePoint(1, x, y, me->GetPositionZ());
Wait_Timer = 0;
}
+6 -14
View File
@@ -90,7 +90,6 @@ public:
player->AreaExploredOrEventHappens(10044);
player->CLOSE_GOSSIP_MENU();
break;
case GOSSIP_ACTION_INFO_DEF + 10:
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_SGG7, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF + 11);
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
@@ -135,12 +134,10 @@ public:
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
}
else
player->SEND_GOSSIP_MENU(player->GetGossipTextId(creature), creature->GetGUID());
return true;
}
};
/*#####
@@ -235,7 +232,6 @@ public:
DoScriptText(SAY_MAG_MORE_REPLY, temp);
me->SummonCreature(NPC_MURK_PUTRIFIER, m_afAmbushB[0]-2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]+2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
me->SummonCreature(NPC_MURK_SCAVENGER, m_afAmbushB[0]+2.5f, m_afAmbushB[1]-2.5f, m_afAmbushB[2], 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
@@ -311,7 +307,6 @@ public:
DoMeleeAttackIfReady();
}
};
};
/*######
@@ -356,7 +351,6 @@ public:
}
}
};
};
/*######
@@ -401,6 +395,7 @@ public:
player->KilledMonsterCredit(NPC_CORKI_CREDIT_1, 0);
}
}
if (go->GetEntry() == GO_CORKIS_PRISON_2)
{
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_2, 25, true))
@@ -411,6 +406,7 @@ public:
player->KilledMonsterCredit(NPC_CORKI_2, 0);
}
}
if (go->GetEntry() == GO_CORKIS_PRISON_3)
{
if (Creature* corki = go->FindNearestCreature(NPC_CORKI_3, 25, true))
@@ -689,15 +685,11 @@ class go_warmaul_prison : public GameObjectScript
if (Creature* prisoner = go->FindNearestCreature(NPC_MAGHAR_PRISONER, 5.0f))
{
if (prisoner)
{
go->UseDoorOrButton();
if (player)
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
go->UseDoorOrButton();
player->KilledMonsterCredit(NPC_MAGHAR_PRISONER, 0);
prisoner->AI()->Talk(SAY_FREE, player->GetGUID());
prisoner->ForcedDespawn(6000);
}
prisoner->AI()->Talk(SAY_FREE, player->GetGUID());
prisoner->ForcedDespawn(6000);
}
return true;
}
+3 -6
View File
@@ -910,8 +910,7 @@ public:
break;
case 12:
if (player)
player->GroupEventHappens(Q_ALMABTRIEB, me);
player->GroupEventHappens(Q_ALMABTRIEB, me);
if (me->FindNearestCreature(N_THADELL, 30))
DoScriptText(SAY_THADELL_1, me); break;
case 13:
@@ -986,16 +985,14 @@ public:
}
break;
case 36: //return and quest_complete
if (player)
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
player->CompleteQuest(QUEST_MARK_V_IS_ALIVE);
break;
}
}
void JustDied(Unit* /*killer*/)
{
Player* player = GetPlayerForEscort();
if (player)
if (Player* player = GetPlayerForEscort())
player->FailQuest(QUEST_MARK_V_IS_ALIVE);
}
@@ -1108,7 +1108,6 @@ public:
break;
case 50:
DoScriptText(SAY_WIL_END, me, player);
player->GroupEventHappens(QUEST_ESCAPE_COILSCAR, me);
break;
}
@@ -349,9 +349,9 @@ public:
case 53: DoScriptText(WHISP18, me, player); break;
case 54: DoScriptText(WHISP19, me, player); break;
case 55: DoScriptText(WHISP20, me, player); break;
case 56: DoScriptText(WHISP21, me, player);
if (player)
player->GroupEventHappens(10211, me);
case 56:
DoScriptText(WHISP21, me, player);
player->GroupEventHappens(10211, me);
break;
}
}
+31 -20
View File
@@ -470,29 +470,40 @@ public:
switch (i)
{
case 0:
{
GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10);
if (Cage)
Cage->SetGoState(GO_STATE_ACTIVE);
}
break;
case 2: DoScriptText(SAY_PROGRESS_1, me, player); break;
case 5: DoScriptText(SAY_PROGRESS_2, me, player); break;
case 6: DoScriptText(SAY_PROGRESS_3, me, player); break;
case 29:DoScriptText(SAY_PROGRESS_4, me, player);
if (player)
{
case 0:
if (GameObject* Cage = me->FindNearestGameObject(GO_CAGE, 10))
Cage->SetGoState(GO_STATE_ACTIVE);
break;
case 2:
DoScriptText(SAY_PROGRESS_1, me, player);
break;
case 5:
DoScriptText(SAY_PROGRESS_2, me, player);
break;
case 6:
DoScriptText(SAY_PROGRESS_3, me, player);
break;
case 29:
DoScriptText(SAY_PROGRESS_4, me, player);
if (player->GetTeam() == ALLIANCE)
player->GroupEventHappens(QUEST_EFTW_A, me);
else if (player->GetTeam() == HORDE)
player->GroupEventHappens(QUEST_EFTW_H, me);
}
me->SetInFront(player); break;
case 30: me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE); break;
case 31: DoCast(me, SPELL_CAT);
me->SetWalk(false);
break;
me->SetInFront(player);
break;
case 30:
me->HandleEmoteCommand(EMOTE_ONESHOT_WAVE);
break;
case 31:
DoCast(me, SPELL_CAT);
me->SetWalk(false);
break;
}
}
@@ -676,7 +687,7 @@ public:
me->SummonCreature(NPC_CABAL_SKRIMISHER, -2793.55f, 5412.79f, -34.53f, 0.0f, TEMPSUMMON_TIMED_DESPAWN_OUT_OF_COMBAT, 25000);
break;
case 11:
if (player && player->GetTypeId() == TYPEID_PLAYER)
if (player->GetTypeId() == TYPEID_PLAYER)
player->GroupEventHappens(QUEST_ESCAPING_THE_TOMB, me);
break;
}
@@ -56,6 +56,7 @@ public:
{
if (creature->GetEntry() == 17900)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_ASH, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
if (creature->GetEntry() == 17901)
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_BLESS_KEL, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1);
}
+1 -1
View File
@@ -337,7 +337,7 @@ class spell_dk_death_pact : public SpellScriptLoader
void FilterTargets(std::list<Unit*>& unitList)
{
Unit* unit_to_add = NULL;
for (std::list<Unit*>::iterator itr = unitList.begin() ; itr != unitList.end(); ++itr)
for (std::list<Unit*>::iterator itr = unitList.begin(); itr != unitList.end(); ++itr)
{
if ((*itr)->GetTypeId() == TYPEID_UNIT
&& (*itr)->GetOwnerGUID() == GetCaster()->GetGUID()
+4 -4
View File
@@ -1589,15 +1589,15 @@ class spell_item_brewfest_mount_transformation : public SpellScriptLoader
{
case SPELL_BREWFEST_MOUNT_TRANSFORM:
if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ;
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
else
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ;
spell_id = caster->GetTeam() == ALLIANCE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
break;
case SPELL_BREWFEST_MOUNT_TRANSFORM_REVERSE:
if (caster->GetSpeedRate(MOVE_RUN) >= 2.0f)
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100 ;
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_100 : SPELL_MOUNT_KODO_100;
else
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60 ;
spell_id = caster->GetTeam() == HORDE ? SPELL_MOUNT_RAM_60 : SPELL_MOUNT_KODO_60;
break;
default:
return;
@@ -371,7 +371,7 @@ class boss_ysondre : public CreatureScript
{
Talk(SAY_YSONDRE_SUMMON_DRUIDS);
for (uint8 i = 0 ; i < 10 ; ++i)
for (uint8 i = 0; i < 10; ++i)
DoCast(me, SPELL_SUMMON_DRUID_SPIRITS, true);
++_stage;
}