Merge branch 'master' of github.com:TrinityCore/TrinityCore into 4.3.4

Conflicts:
	src/server/game/Battlegrounds/BattlegroundMgr.cpp
	src/server/game/Entities/Player/Player.cpp
	src/server/game/Handlers/QuestHandler.cpp
	src/server/game/Spells/SpellInfo.h
	src/server/game/World/World.cpp
This commit is contained in:
Vincent_Michael
2013-12-15 03:47:21 +01:00
56 changed files with 455 additions and 117 deletions
@@ -0,0 +1,8 @@
-- Bladespire Mystic SAI
SET @ENTRY := 20766;
UPDATE `creature_template` SET `AIName`="SmartAI" WHERE `entry`=@ENTRY;
DELETE FROM `smart_scripts` WHERE `entryorguid`=@ENTRY AND `source_type`=0;
INSERT INTO `smart_scripts` (`entryorguid`,`source_type`,`id`,`link`,`event_type`,`event_phase_mask`,`event_chance`,`event_flags`,`event_param1`,`event_param2`,`event_param3`,`event_param4`,`action_type`,`action_param1`,`action_param2`,`action_param3`,`action_param4`,`action_param5`,`action_param6`,`target_type`,`target_param1`,`target_param2`,`target_param3`,`target_x`,`target_y`,`target_z`,`target_o`,`comment`) VALUES
(@ENTRY,0,0,0,1,0,100,0,0,0,600000,600000,11,12550,0,0,0,0,0,1,0,0,0,0,0,0,0,"Bladespire Mystic - OOC - Cast Lightning Shield"),
(@ENTRY,0,1,0,16,0,100,0,37599,30,600000,600000,11,37599,0,0,0,0,0,9,0,0,0,0,0,0,0,"Bladespire Mystic - OOC - Friendly in range Cast Bloodlust"),
(@ENTRY,0,2,0,74,0,100,0,0,70,7500,14000,11,11986,0,0,0,0,0,9,0,0,0,0,0,0,0,"Bladespire Mystic - Friendly HP below 70% - Cast Healing Wave");
@@ -0,0 +1,34 @@
UPDATE `creature_template` SET `ScriptName`="npc_king_jokkum_vehicle" WHERE `entry`=30331;
-- Pathing for King Jokkum Entry: 30331
-- by malcrom
SET @PATH := 2072200;
DELETE FROM `waypoint_data` WHERE `id` IN (@PATH, @PATH+1);
INSERT INTO `waypoint_data` (`id`,`point`,`position_x`,`position_y`,`position_z`,`orientation`,`delay`,`move_flag`,`action`,`action_chance`,`wpguid`) VALUES
-- Path to event
(@PATH,1,7357.088,-2865.398,803.5008,0,0,1,0,100,0),
(@PATH,2,7357.088,-2865.398,803.5008,0,0,1,0,100,0),
(@PATH,3,7355.184,-2904.322,821.0084,0,0,1,0,100,0),
(@PATH,4,7355.473,-2946.654,833.0916,0,0,1,0,100,0),
(@PATH,5,7360.866,-2994.785,845.9886,0,0,1,0,100,0),
(@PATH,6,7378.764,-3035.887,840.6003,0,0,1,0,100,0),
(@PATH,7,7411.658,-3072.211,837.5768,0,0,1,0,100,0),
(@PATH,8,7453.996,-3088.695,837.5768,0,0,1,0,100,0),
(@PATH,9,7496.08,-3113.922,837.5829,0,0,1,0,100,0),
(@PATH,10,7536.843,-3136.489,837.5808,0,0,1,0,100,0),
(@PATH,11,7564.738,-3145.144,844.8308,0,0,1,0,100,0),
(@PATH,12,7604.358,-3171.258,850.8867,0,0,1,0,100,0),
(@PATH,13,7635.467,-3207.211,857.19,0,0,1,0,100,0),
(@PATH,14,7657.858,-3219.258,863.19,0,0,1,0,100,0),
(@PATH,15,7706.542,-3219.742,864.3326,0,0,1,0,100,0),
(@PATH,16,7747.335,-3226.993,862.4576,0,0,1,0,100,0),
(@PATH,17,7796.658,-3221.782,860.6461,0,0,1,0,100,0),
(@PATH,18,7827.596,-3229.273,856.4147,0,0,1,0,100,0),
(@PATH,19,7846.174,-3253.239,852.1281,0,0,1,0,100,0),
(@PATH,20,7846.174,-3253.239,852.1281,0.418879,0,1,0,100,0),
-- Path after event and despawn
(@PATH+1,1,7837.094,-3235.536,853.8781,0,0,1,0,100,0),
(@PATH+1,2,7828.622,-3230.38,855.9147,0,0,1,0,100,0),
(@PATH+1,3,7793.782,-3219.743,861.1461,0,0,1,0,100,0),
(@PATH+1,4,7765.224,-3225.374,864.0826,0,0,1,0,100,0),
(@PATH+1,5,7736.733,-3226.5,861.4576,0,0,1,0,100,0);
+7 -2
View File
@@ -28,6 +28,7 @@
void UnitAI::AttackStart(Unit* victim)
{
if (victim && me->Attack(victim, true))
me->GetMotionMaster()->MoveChase(victim);
}
@@ -44,14 +45,18 @@ void UnitAI::DoMeleeAttackIfReady()
return;
Unit* victim = me->GetVictim();
if (!me->IsWithinMeleeRange(victim))
return;
//Make sure our attack is ready and we aren't currently casting before checking distance
if (me->isAttackReady() && me->IsWithinMeleeRange(victim))
if (me->isAttackReady())
{
me->AttackerStateUpdate(victim);
me->resetAttackTimer();
}
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK) && me->IsWithinMeleeRange(victim))
if (me->haveOffhandWeapon() && me->isAttackReady(OFF_ATTACK))
{
me->AttackerStateUpdate(victim, OFF_ATTACK);
me->resetAttackTimer(OFF_ATTACK);
+23 -20
View File
@@ -67,7 +67,10 @@ SmartAI::SmartAI(Creature* c) : CreatureAI(c)
mFollowCredit = 0;
mFollowArrivedEntry = 0;
mFollowCreditType = 0;
mFollowArrivedTimer = 0;
mInvincibilityHpLevel = 0;
mJustReset = false;
}
void SmartAI::UpdateDespawn(const uint32 diff)
@@ -88,13 +91,6 @@ void SmartAI::UpdateDespawn(const uint32 diff)
} else mDespawnTime -= diff;
}
void SmartAI::Reset()
{
if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
SetRun(mRun);
GetScript()->OnReset();
}
WayPoint* SmartAI::GetNextWayPoint()
{
if (!mWayPoints || mWayPoints->empty())
@@ -476,7 +472,8 @@ void SmartAI::EnterEvadeMode()
else
me->GetMotionMaster()->MoveTargetedHome();
Reset();
if (!HasEscortState(SMART_ESCORT_ESCORTING))//dont mess up escort movement after combat
SetRun(mRun);
}
void SmartAI::MoveInLineOfSight(Unit* who)
@@ -567,7 +564,8 @@ void SmartAI::JustRespawned()
if (me->getFaction() != me->GetCreatureTemplate()->faction_A)
me->RestoreFaction();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
Reset();
mJustReset = true;
JustReachedHome();
mFollowGuid = 0;//do not reset follower on Reset(), we need it after combat evade
mFollowDist = 0;
mFollowAngle = 0;
@@ -586,10 +584,17 @@ int SmartAI::Permissible(const Creature* creature)
void SmartAI::JustReachedHome()
{
GetScript()->ProcessEventsFor(SMART_EVENT_REACHED_HOME);
GetScript()->OnReset();
if (!UpdateVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE && me->GetWaypointPath())
me->ToCreature()->GetMotionMaster()->MovePath(me->GetWaypointPath(), true);
if (!mJustReset)
{
GetScript()->ProcessEventsFor(SMART_EVENT_REACHED_HOME);
if (!UpdateVictim() && me->GetMotionMaster()->GetCurrentMovementGeneratorType() == IDLE_MOTION_TYPE && me->GetWaypointPath())
me->ToCreature()->GetMotionMaster()->MovePath(me->GetWaypointPath(), true);
}
mJustReset = false;
}
void SmartAI::EnterCombat(Unit* enemy)
@@ -597,6 +602,9 @@ void SmartAI::EnterCombat(Unit* enemy)
me->InterruptNonMeleeSpells(false); // must be before ProcessEvents
GetScript()->ProcessEventsFor(SMART_EVENT_AGGRO, enemy);
me->GetPosition(&mLastOOCPos);
SetRun(mRun);
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
}
void SmartAI::JustDied(Unit* killer)
@@ -618,16 +626,10 @@ void SmartAI::JustSummoned(Creature* creature)
void SmartAI::AttackStart(Unit* who)
{
if (who && me->Attack(who, true))
if (who && me->Attack(who, me->IsWithinMeleeRange(who)))
{
SetRun(mRun);
if (me->GetMotionMaster()->GetMotionSlotType(MOTION_SLOT_ACTIVE) == POINT_MOTION_TYPE)
me->GetMotionMaster()->MovementExpired();
if (mCanCombatMove)
me->GetMotionMaster()->MoveChase(who);
me->GetPosition(&mLastOOCPos);
}
}
@@ -692,7 +694,8 @@ void SmartAI::InitializeAI()
{
GetScript()->OnInitialize(me);
if (!me->isDead())
Reset();
mJustReset = true;
JustReachedHome();
GetScript()->ProcessEventsFor(SMART_EVENT_RESPAWN);
}
+2 -4
View File
@@ -71,10 +71,7 @@ class SmartAI : public CreatureAI
// Called when creature is spawned or respawned
void JustRespawned();
// Called after InitializeAI(), EnterEvadeMode() for resetting variables
void Reset();
// Called at reaching home after evade
// Called at reaching home after evade, InitializeAI(), EnterEvadeMode() for resetting variables
void JustReachedHome();
// Called for reaction at enter to combat if not in combat yet (enemy can be NULL)
@@ -232,6 +229,7 @@ class SmartAI : public CreatureAI
uint32 mDespawnState;
void UpdateDespawn(const uint32 diff);
uint32 mEscortInvokerCheckTimer;
bool mJustReset;
};
class SmartGameObjectAI : public GameObjectAI
@@ -369,7 +369,7 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
if (IsPlayer(*itr))
if (Quest const* q = sObjectMgr->GetQuestTemplate(e.action.quest.quest))
{
(*itr)->ToPlayer()->AddQuest(q, NULL);
(*itr)->ToPlayer()->AddQuestAndCheckCompletion(q, NULL);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction:: SMART_ACTION_ADD_QUEST: Player guidLow %u add quest %u",
(*itr)->GetGUIDLow(), e.action.quest.quest);
}
@@ -973,12 +973,16 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_UPDATE_TEMPLATE:
{
if (!me || me->GetEntry() == e.action.updateTemplate.creature)
ObjectList* targets = GetTargets(e, unit);
if (!targets)
break;
me->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE);
TC_LOG_DEBUG("scripts.ai", "SmartScript::ProcessAction: SMART_ACTION_UPDATE_TEMPLATE: Creature %u, Template: %u, Team: %u",
me->GetGUIDLow(), me->GetEntry(), e.action.updateTemplate.team ? HORDE : ALLIANCE);
for (ObjectList::const_iterator itr = targets->begin(); itr != targets->end(); ++itr)
if (IsCreature(*itr))
(*itr)->ToCreature()->UpdateEntry(e.action.updateTemplate.creature, e.action.updateTemplate.team ? HORDE : ALLIANCE);
delete targets;
break;
}
case SMART_ACTION_DIE:
@@ -1042,8 +1046,9 @@ void SmartScript::ProcessAction(SmartScriptHolder& e, Unit* unit, uint32 var0, u
}
case SMART_ACTION_SET_INGAME_PHASE_MASK:
{
if (GetBaseObject())
GetBaseObject()->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
if (WorldObject* baseObj = GetBaseObject())
baseObj->SetPhaseMask(e.action.ingamePhaseMask.mask, true);
break;
}
case SMART_ACTION_MOUNT_TO_ENTRY_OR_MODEL:
@@ -805,7 +805,7 @@ bool SmartAIMgr::IsEventValid(SmartScriptHolder& e)
break;
}
case SMART_ACTION_UPDATE_TEMPLATE:
if (e.action.updateTemplate.creature && !IsCreatureValid(e, e.action.updateTemplate.creature))
if (!IsCreatureValid(e, e.action.updateTemplate.creature))
return false;
break;
case SMART_ACTION_SET_SHEATH:
@@ -1037,6 +1037,10 @@ struct SmartTarget
raw.param1 = p1;
raw.param2 = p2;
raw.param3 = p3;
x = 0.0f;
y = 0.0f;
z = 0.0f;
o = 0.0f;
}
SMARTAI_TARGETS type;
float x, y, z, o;
@@ -46,8 +46,10 @@ Battlefield::Battlefield()
m_MapId = 0;
m_MaxPlayer = 0;
m_MinPlayer = 0;
m_MinLevel = 0;
m_BattleTime = 0;
m_NoWarBattleTime = 0;
m_RestartAfterCrash = 0;
m_TimeForAcceptInvite = 20;
m_uiKickDontAcceptTimer = 1000;
@@ -1064,4 +1064,5 @@ void WintergraspCapturePoint::ChangeTeam(TeamId /*oldTeam*/)
BfGraveyardWG::BfGraveyardWG(BattlefieldWG* battlefield) : BfGraveyard(battlefield)
{
m_Bf = battlefield;
m_GossipTextId = 0;
}
@@ -1481,6 +1481,7 @@ struct WGWorkshop
bf = _bf;
workshopId = _workshopId;
teamControl = BATTLEFIELD_WG_TEAM_NEUTRAL;
state = BATTLEFIELD_WG_OBJECTSTATE_NONE;
}
void GiveControlTo(uint8 team, bool init /* for first call in setup*/)
@@ -150,6 +150,7 @@ Battleground::Battleground()
m_ResetStatTimer = 0;
m_ValidStartPositionTimer = 0;
m_Events = 0;
m_StartDelayTime = 0;
m_IsRated = false;
m_BuffChange = false;
m_IsRandom = false;
@@ -167,6 +168,7 @@ Battleground::Battleground()
m_MapId = 0;
m_Map = NULL;
m_StartMaxDist = 0.0f;
ScriptId = 0;
m_TeamStartLocX[TEAM_ALLIANCE] = 0;
m_TeamStartLocX[TEAM_HORDE] = 0;
@@ -186,6 +188,9 @@ Battleground::Battleground()
m_ArenaTeamRatingChanges[TEAM_ALLIANCE] = 0;
m_ArenaTeamRatingChanges[TEAM_HORDE] = 0;
m_ArenaTeamMMR[TEAM_ALLIANCE] = 0;
m_ArenaTeamMMR[TEAM_HORDE] = 0;
m_BgRaids[TEAM_ALLIANCE] = NULL;
m_BgRaids[TEAM_HORDE] = NULL;
@@ -196,6 +201,7 @@ Battleground::Battleground()
m_TeamScores[TEAM_HORDE] = 0;
m_PrematureCountDown = false;
m_PrematureCountDownTimer = 0;
m_HonorMode = BG_NORMAL;
@@ -35,6 +35,27 @@ BattlegroundAB::BattlegroundAB()
BgObjects.resize(BG_AB_OBJECT_MAX);
BgCreatures.resize(BG_AB_ALL_NODES_COUNT + 5);//+5 for aura triggers
for (uint8 i = 0; i < BG_AB_DYNAMIC_NODES_COUNT; ++i)
{
m_Nodes[i] = 0;
m_prevNodes[i] = 0;
m_NodeTimers[i] = 0;
m_BannerTimers[i].timer = 0;
m_BannerTimers[i].type = 0;
m_BannerTimers[i].teamIndex = 0;
}
for (uint8 i = 0; i < BG_TEAMS_COUNT; ++i)
{
m_lastTick[i] = 0;
m_HonorScoreTics[i] = 0;
m_ReputationScoreTics[i] = 0;
m_TeamScores500Disadvantage[i] = false;
}
m_HonorTics = 0;
m_ReputationTics = 0;
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AB_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AB_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AB_START_HALF_MINUTE;
@@ -33,6 +33,25 @@ BattlegroundAV::BattlegroundAV()
BgObjects.resize(BG_AV_OBJECT_MAX);
BgCreatures.resize(AV_CPLACE_MAX+AV_STATICCPLACE_MAX);
for (uint8 i = 0; i < 2; i++)
{
for (uint8 j = 0; j < 9; j++)
m_Team_QuestStatus[i][j] = 0;
m_Team_Scores[i] = 0;
m_IsInformedNearVictory[i] = false;
m_CaptainAlive[i] = true;
m_CaptainBuffTimer[i] = 0;
m_Mine_Owner[i] = 0;
m_Mine_PrevOwner[i] = 0;
m_Mine_Reclaim_Timer[i] = 0;
}
m_Mine_Timer = 0;
m_MaxLevel = 0;
for (BG_AV_Nodes i = BG_AV_NODES_FIRSTAID_STATION; i < BG_AV_NODES_MAX; ++i)
InitNode(i, 0, false);
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_AV_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_AV_START_ONE_MINUTE;
StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_AV_START_HALF_MINUTE;
@@ -29,6 +29,12 @@ BattlegroundDS::BattlegroundDS()
BgObjects.resize(BG_DS_OBJECT_MAX);
BgCreatures.resize(BG_DS_NPC_MAX);
_waterfallTimer = 0;
_waterfallStatus = 0;
_waterfallKnockbackTimer = 0;
_pipeKnockBackTimer = 0;
_pipeKnockBackCount = 0;
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
@@ -43,6 +43,28 @@ BattlegroundEY::BattlegroundEY()
m_Points_Trigger[BLOOD_ELF] = TR_BLOOD_ELF_BUFF;
m_Points_Trigger[DRAENEI_RUINS] = TR_DRAENEI_RUINS_BUFF;
m_Points_Trigger[MAGE_TOWER] = TR_MAGE_TOWER_BUFF;
m_HonorScoreTics[TEAM_ALLIANCE] = 0;
m_HonorScoreTics[TEAM_HORDE] = 0;
m_TeamPointsCount[TEAM_ALLIANCE] = 0;
m_TeamPointsCount[TEAM_HORDE] = 0;
m_FlagKeeper = 0;
m_DroppedFlagGUID = 0;
m_FlagCapturedBgObjectType = 0;
m_FlagState = BG_EY_FLAG_STATE_ON_BASE;
m_FlagsTimer = 0;
m_TowerCapCheckTimer = 0;
m_PointAddingTimer = 0;
m_HonorTics = 0;
for (uint8 i = 0; i < EY_POINTS_MAX; ++i)
{
m_PointOwnedByTeam[i] = EY_POINT_NO_OWNER;
m_PointState[i] = EY_POINT_STATE_UNCONTROLLED;
m_PointBarStatus[i] = BG_EY_PROGRESS_BAR_STATE_MIDDLE;
}
for (uint8 i = 0; i < 2 * EY_POINTS_MAX; ++i)
m_CurrentPointPlayersCount[i] = 0;
StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_EY_START_TWO_MINUTES;
StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_EY_START_ONE_MINUTE;
@@ -28,6 +28,10 @@ BattlegroundRV::BattlegroundRV()
{
BgObjects.resize(BG_RV_OBJECT_MAX);
Timer = 0;
State = 0;
PillarCollision = false;
StartDelayTimes[BG_STARTING_EVENT_FIRST] = BG_START_DELAY_1M;
StartDelayTimes[BG_STARTING_EVENT_SECOND] = BG_START_DELAY_30S;
StartDelayTimes[BG_STARTING_EVENT_THIRD] = BG_START_DELAY_15S;
@@ -37,6 +37,22 @@ BattlegroundSA::BattlegroundSA()
SignaledRoundTwo = false;
SignaledRoundTwoHalfMin = false;
InitSecondRound = false;
gateDestroyed = false;
Attackers = TEAM_ALLIANCE;
TotalTime = 0;
EndRoundTimer = 0;
ShipsStarted = false;
Status = BG_SA_NOTSTARTED;
for (uint8 i = 0; i < 6; i++)
GateStatus[i] = BG_SA_GATE_OK;
for (uint8 i = 0; i < 2; i++)
{
RoundScores[i].winner = TEAM_ALLIANCE;
RoundScores[i].time = 0;
_allVehiclesAlive[i] = true;
}
//! This is here to prevent an uninitialised variable warning
//! The warning only occurs when SetUpBattleGround fails though.
@@ -54,6 +54,21 @@ BattlegroundWS::BattlegroundWS()
_flagSpellForceTimer = 0;
_bothFlagsKept = false;
_flagDebuffState = 0;
m_FlagKeepers[TEAM_ALLIANCE] = 0;
m_FlagKeepers[TEAM_HORDE] = 0;
m_DroppedFlagGUID[TEAM_ALLIANCE] = 0;
m_DroppedFlagGUID[TEAM_HORDE] = 0;
_flagState[TEAM_ALLIANCE] = BG_WS_FLAG_STATE_ON_BASE;
_flagState[TEAM_HORDE] = BG_WS_FLAG_STATE_ON_BASE;
_flagsTimer[TEAM_ALLIANCE] = 0;
_flagsTimer[TEAM_HORDE] = 0;
_flagsDropTimer[TEAM_ALLIANCE] = 0;
_flagsDropTimer[TEAM_HORDE] = 0;
_lastFlagCaptureTeam = 0;
m_ReputationCapture = 0;
m_HonorWinKills = 0;
m_HonorEndKills = 0;
_minutesElapsed = 0;
}
BattlegroundWS::~BattlegroundWS() { }
+1 -1
View File
@@ -34,7 +34,7 @@ CalendarEvent::~CalendarEvent()
sCalendarMgr->FreeEventId(_eventId);
}
CalendarMgr::CalendarMgr() { }
CalendarMgr::CalendarMgr() : _maxEventId(0), _maxInviteId(0) { }
CalendarMgr::~CalendarMgr()
{
@@ -192,6 +192,7 @@ struct Condition
SourceType = CONDITION_SOURCE_TYPE_NONE;
SourceGroup = 0;
SourceEntry = 0;
SourceId = 0;
ElseGroup = 0;
ConditionType = CONDITION_NONE;
ConditionTarget = 0;
@@ -147,7 +147,7 @@ m_PlayerDamageReq(0), m_lootRecipient(0), m_lootRecipientGroup(0), m_corpseRemov
m_respawnDelay(300), m_corpseDelay(60), m_respawnradius(0.0f), m_reactState(REACT_AGGRESSIVE),
m_defaultMovementType(IDLE_MOTION_TYPE), m_DBTableGuid(0), m_equipmentId(0), m_originalEquipmentId(0), m_AlreadyCallAssistance(false),
m_AlreadySearchedAssistance(false), m_regenHealth(true), m_AI_locked(false), m_meleeDamageSchoolMask(SPELL_SCHOOL_MASK_NORMAL),
m_creatureInfo(NULL), m_creatureData(NULL), m_path_id(0), m_formation(NULL)
m_originalEntry(0), m_homePosition(), m_transportHomePosition(), m_creatureInfo(NULL), m_creatureData(NULL), m_waypointID(0), m_path_id(0), m_formation(NULL)
{
m_regenTimer = CREATURE_REGEN_INTERVAL;
m_valuesCount = UNIT_END;
+4 -1
View File
@@ -244,7 +244,10 @@ typedef UNORDERED_MAP<uint32, EquipmentInfoContainerInternal> EquipmentInfoConta
// from `creature` table
struct CreatureData
{
CreatureData() : dbData(true) { }
CreatureData() : id(0), mapid(0), phaseMask(0), displayid(0), equipmentId(0),
posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f), spawntimesecs(0),
spawndist(0.0f), currentwaypoint(0), curhealth(0), curmana(0), movementType(0),
spawnMask(0), npcflag(0), unit_flags(0), dynamicflags(0), dbData(true) { }
uint32 id; // entry in creature_template
uint16 mapid;
uint32 phaseMask;
@@ -27,6 +27,7 @@
GossipMenu::GossipMenu()
{
_menuId = 0;
_locale = DEFAULT_LOCALE;
}
GossipMenu::~GossipMenu()
@@ -590,7 +590,9 @@ enum GOState
// from `gameobject`
struct GameObjectData
{
explicit GameObjectData() : dbData(true) { }
explicit GameObjectData() : id(0), mapid(0), phaseMask(0), posX(0.0f), posY(0.0f), posZ(0.0f), orientation(0.0f),
rotation0(0.0f), rotation1(0.0f), rotation2(0.0f), rotation3(0.0f), spawntimesecs(0),
animprogress(0), go_state(GO_STATE_ACTIVE), spawnMask(0), artKit(0), dbData(true) { }
uint32 id; // entry in gamobject_template
uint16 mapid;
uint32 phaseMask;
+1 -1
View File
@@ -1264,7 +1264,7 @@ void MovementInfo::OutDebug()
TC_LOG_INFO("misc", "splineElevation: %f", splineElevation);
}
WorldObject::WorldObject(bool isWorldObject): WorldLocation(),
WorldObject::WorldObject(bool isWorldObject) : WorldLocation(), LastUsedScriptID(0),
m_name(""), m_isActive(false), m_isWorldObject(isWorldObject), m_zoneScript(NULL),
m_transport(NULL), m_currMap(NULL), m_InstanceId(0),
m_phaseMask(PHASEMASK_NORMAL), m_notifyflags(0), m_executed_notifies(0)
+73 -8
View File
@@ -79,6 +79,7 @@
#include "WorldPacket.h"
#include "WorldSession.h"
#include "MovementStructures.h"
#include "GameObjectAI.h"
#define ZONE_UPDATE_INTERVAL (1*IN_MILLISECONDS)
@@ -683,6 +684,7 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
m_session = session;
m_divider = 0;
m_ingametime = 0;
m_ExtraFlags = 0;
@@ -708,6 +710,7 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
m_zoneUpdateTimer = 0;
m_areaUpdateId = 0;
m_team = 0;
m_nextSave = sWorld->getIntConfig(CONFIG_INTERVAL_SAVE);
@@ -769,6 +772,8 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
m_logintime = time(NULL);
m_Last_tick = m_logintime;
m_Played_time[PLAYED_TIME_TOTAL] = 0;
m_Played_time[PLAYED_TIME_LEVEL] = 0;
m_WeaponProficiency = 0;
m_ArmorProficiency = 0;
m_canParry = false;
@@ -811,6 +816,7 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
m_InstanceValid = true;
m_dungeonDifficulty = DUNGEON_DIFFICULTY_NORMAL;
m_raidDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
m_raidMapDifficulty = RAID_DIFFICULTY_10MAN_NORMAL;
m_lastPotionId = 0;
_talentMgr = new PlayerTalentInfo();
@@ -845,6 +851,18 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
m_movedPlayer = this;
m_seer = this;
m_recallMap = 0;
m_recallX = 0;
m_recallY = 0;
m_recallZ = 0;
m_recallO = 0;
m_homebindMapId = 0;
m_homebindAreaId = 0;
m_homebindX = 0;
m_homebindY = 0;
m_homebindZ = 0;
m_contestedPvPTimer = 0;
m_declinedname = NULL;
@@ -864,7 +882,11 @@ Player::Player(WorldSession* session): Unit(true), phaseMgr(this)
m_ChampioningFaction = 0;
for (uint8 i = 0; i < MAX_POWERS_PER_CLASS; ++i)
m_timeSyncTimer = 0;
m_timeSyncClient = 0;
m_timeSyncServer = 0;
for (uint8 i = 0; i < MAX_POWERS; ++i)
m_powerFraction[i] = 0;
isDebugAreaTriggers = false;
@@ -14803,11 +14825,7 @@ void Player::SendPreparedQuest(uint64 guid)
}
if (quest->IsAutoAccept() && CanAddQuest(quest, true) && CanTakeQuest(quest, true))
{
AddQuest(quest, object);
if (CanCompleteQuest(questId))
CompleteQuest(questId);
}
AddQuestAndCheckCompletion(quest, object);
if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
PlayerTalkClass->SendQuestGiverRequestItems(quest, guid, CanCompleteRepeatableQuest(quest), true);
@@ -15095,6 +15113,53 @@ bool Player::CanRewardQuest(Quest const* quest, bool msg)
return true;
}
void Player::AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver)
{
AddQuest(quest, questGiver);
if (CanCompleteQuest(quest->GetQuestId()))
CompleteQuest(quest->GetQuestId());
if (!questGiver)
return;
switch (questGiver->GetTypeId())
{
case TYPEID_UNIT:
sScriptMgr->OnQuestAccept(this, (questGiver->ToCreature()), quest);
questGiver->ToCreature()->AI()->sQuestAccept(this, quest);
break;
case TYPEID_ITEM:
case TYPEID_CONTAINER:
{
Item* item = (Item*)questGiver;
sScriptMgr->OnQuestAccept(this, item, quest);
// destroy not required for quest finish quest starting item
bool destroyItem = true;
for (int i = 0; i < QUEST_ITEM_OBJECTIVES_COUNT; ++i)
{
if (quest->RequiredItemId[i] == item->GetEntry() && item->GetTemplate()->MaxCount > 0)
{
destroyItem = false;
break;
}
}
if (destroyItem)
DestroyItem(item->GetBagSlot(), item->GetSlot(), true);
break;
}
case TYPEID_GAMEOBJECT:
sScriptMgr->OnQuestAccept(this, questGiver->ToGameObject(), quest);
questGiver->ToGameObject()->AI()->QuestAccept(this, quest);
break;
default:
break;
}
}
bool Player::CanRewardQuest(Quest const* quest, uint32 reward, bool msg)
{
// prevent receive reward with quest items in bank or for not completed quest
@@ -15403,7 +15468,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
if (quest->GetRewSpellCast() > 0)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(quest->GetRewSpellCast());
if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
if (questGiver->isType(TYPEMASK_UNIT) && (!spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL) || !spellInfo->HasEffect(SPELL_EFFECT_CREATE_ITEM)))
{
if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
creature->CastSpell(this, quest->GetRewSpellCast(), true);
@@ -15414,7 +15479,7 @@ void Player::RewardQuest(Quest const* quest, uint32 reward, Object* questGiver,
else if (quest->GetRewSpell() > 0)
{
SpellInfo const* spellInfo = sSpellMgr->GetSpellInfo(quest->GetRewSpell());
if (questGiver->isType(TYPEMASK_UNIT) && !spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL))
if (questGiver->isType(TYPEMASK_UNIT) && (!spellInfo->HasEffect(SPELL_EFFECT_LEARN_SPELL) || !spellInfo->HasEffect(SPELL_EFFECT_CREATE_ITEM)))
{
if (Creature* creature = GetMap()->GetCreature(questGiver->GetGUID()))
creature->CastSpell(this, quest->GetRewSpell(), true);
+1
View File
@@ -1534,6 +1534,7 @@ class Player : public Unit, public GridObject<Player>
bool CanCompleteRepeatableQuest(Quest const* quest);
bool CanRewardQuest(Quest const* quest, bool msg);
bool CanRewardQuest(Quest const* quest, uint32 reward, bool msg);
void AddQuestAndCheckCompletion(Quest const* quest, Object* questGiver);
void AddQuest(Quest const* quest, Object* questGiver);
void CompleteQuest(uint32 quest_id);
void IncompleteQuest(uint32 quest_id);
+3 -3
View File
@@ -165,7 +165,7 @@ Unit::Unit(bool isWorldObject) :
IsAIEnabled(false), NeedChangeAI(false), LastCharmerGUID(0),
m_ControlledByPlayer(false), movespline(new Movement::MoveSpline()),
i_AI(NULL), i_disabledAI(NULL), m_AutoRepeatFirstCast(false), m_procDeep(0),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_ThreatManager(this),
m_removedAurasCount(0), i_motionMaster(new MotionMaster(this)), m_regenTimer(0), m_ThreatManager(this),
m_vehicle(NULL), m_vehicleKit(NULL), m_unitTypeMask(UNIT_MASK_NONE),
m_HostileRefManager(this), _lastDamagedTime(0)
{
@@ -11841,8 +11841,8 @@ void Unit::DeleteCharmInfo()
}
CharmInfo::CharmInfo(Unit* unit)
: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false),
_isCommandAttack(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
: _unit(unit), _CommandState(COMMAND_FOLLOW), _petnumber(0), _barInit(false), _oldReactState(REACT_PASSIVE),
_isCommandAttack(false), _isCommandFollow(false), _isAtStay(false), _isFollowing(false), _isReturning(false),
_stayX(0.0f), _stayY(0.0f), _stayZ(0.0f)
{
for (uint8 i = 0; i < MAX_SPELL_CHARM; ++i)
+1 -1
View File
@@ -35,7 +35,7 @@
#include "Battleground.h"
Vehicle::Vehicle(Unit* unit, VehicleEntry const* vehInfo, uint32 creatureEntry) :
UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE)
UsableSeatNum(0), _me(unit), _vehicleInfo(vehInfo), _creatureEntry(creatureEntry), _status(STATUS_NONE), _lastShootPos()
{
for (uint32 i = 0; i < MAX_VEHICLE_SEATS; ++i)
{
+2 -1
View File
@@ -55,7 +55,8 @@ typedef std::map<uint32 /*condition id*/, GameEventFinishCondition> GameEventCon
struct GameEventData
{
GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL) { }
GameEventData() : start(1), end(0), nextstart(0), occurence(0), length(0), holiday_id(HOLIDAY_NONE), state(GAMEEVENT_NORMAL),
announce(0) { }
time_t start; // occurs after this time
time_t end; // occurs before this time
time_t nextstart; // after this time the follow-up events count this phase completed
+12 -17
View File
@@ -239,6 +239,7 @@ void WorldSession::HandleQuestgiverAcceptQuestOpcode(WorldPacket& recvData)
default:
break;
}
_player->PlayerTalkClass->SendCloseGossip();
if (quest->GetSrcSpell() > 0)
@@ -278,11 +279,7 @@ void WorldSession::HandleQuestgiverQueryQuestOpcode(WorldPacket& recvData)
return;
if (quest->IsAutoAccept() && _player->CanAddQuest(quest, true))
{
_player->AddQuest(quest, object);
if (_player->CanCompleteQuest(questId))
_player->CompleteQuest(questId);
}
_player->AddQuestAndCheckCompletion(quest, object);
if (quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
_player->PlayerTalkClass->SendQuestGiverRequestItems(quest, object->GetGUID(), _player->CanCompleteQuest(quest->GetQuestId()), true);
@@ -361,9 +358,10 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
{
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
{
_player->AddQuest(nextQuest, object);
if (_player->CanCompleteQuest(nextQuest->GetQuestId()))
_player->CompleteQuest(nextQuest->GetQuestId());
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
_player->AddQuestAndCheckCompletion(nextQuest, object);
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
@@ -382,9 +380,10 @@ void WorldSession::HandleQuestgiverChooseRewardOpcode(WorldPacket& recvData)
{
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
{
_player->AddQuest(nextQuest, object);
if (_player->CanCompleteQuest(nextQuest->GetQuestId()))
_player->CompleteQuest(nextQuest->GetQuestId());
if (nextQuest->IsAutoAccept() && _player->CanAddQuest(nextQuest, true) && _player->CanTakeQuest(nextQuest, true))
_player->AddQuestAndCheckCompletion(nextQuest, object);
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
}
_player->PlayerTalkClass->SendQuestGiverQuestDetails(nextQuest, guid, true);
@@ -507,7 +506,7 @@ void WorldSession::HandleQuestConfirmAccept(WorldPacket& recvData)
return;
if (_player->CanAddQuest(quest, true))
_player->AddQuest(quest, NULL); // NULL, this prevent DB script from duplicate running
_player->AddQuestAndCheckCompletion(quest, NULL); // NULL, this prevent DB script from duplicate running
_player->SetDivider(0);
}
@@ -631,11 +630,7 @@ void WorldSession::HandlePushQuestToParty(WorldPacket& recvPacket)
sender->SendPushToPartyResponse(receiver, QUEST_PARTY_MSG_SHARING_QUEST);
if (quest->IsAutoAccept() && receiver->CanAddQuest(quest, true) && receiver->CanTakeQuest(quest, true))
{
receiver->AddQuest(quest, sender);
if (receiver->CanCompleteQuest(questId))
receiver->CompleteQuest(questId);
}
receiver->AddQuestAndCheckCompletion(quest, sender);
if ((quest->IsAutoComplete() && quest->IsRepeatable() && !quest->IsDailyOrWeekly()) || quest->HasFlag(QUEST_FLAGS_AUTOCOMPLETE))
receiver->PlayerTalkClass->SendQuestGiverRequestItems(quest, sender->GetGUID(), receiver->CanCompleteRepeatableQuest(quest), true);
+1
View File
@@ -364,6 +364,7 @@ LootItem::LootItem(LootStoreItem const& li)
randomSuffix = GenerateEnchSuffixFactor(itemid);
randomPropertyId = Item::GenerateItemRandomPropertyId(itemid);
count = 0;
is_looted = 0;
is_blocked = 0;
is_underthreshold = 0;
+4 -2
View File
@@ -148,7 +148,9 @@ struct LootItem
explicit LootItem(LootStoreItem const& li);
// Empty constructor for creating an empty LootItem to be filled in with DB data
LootItem() : canSave(true){ };
LootItem() : itemid(0), randomSuffix(0), randomPropertyId(0), count(0), is_looted(false), is_blocked(false),
freeforall(false), is_underthreshold(false), is_counted(false), needs_quest(false), follow_loot_rules(false),
canSave(true){ };
// Basic checks for player/item compatibility - if false no chance to see the item in the loot
bool AllowedForPlayer(Player const* player) const;
@@ -303,7 +305,7 @@ struct Loot
// Only set for inventory items that can be right-click looted
uint32 containerID;
Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { }
Loot(uint32 _gold = 0) : gold(_gold), unlootedCount(0), roundRobinPlayer(0), loot_type(LOOT_CORPSE), maxDuplicates(1), containerID(0) { }
~Loot() { clear(); }
// For deleting items at loot removal since there is no backward interface to the Item()
+1
View File
@@ -1375,6 +1375,7 @@ GridMap::GridMap()
// Height level data
_gridHeight = INVALID_HEIGHT;
_gridGetHeight = &GridMap::getHeightFromFlat;
_gridIntHeightMultiplier = 0;
m_V9 = NULL;
m_V8 = NULL;
// Liquid data
+3
View File
@@ -43,6 +43,9 @@ MapManager::MapManager()
{
i_gridCleanUpDelay = sWorld->getIntConfig(CONFIG_INTERVAL_GRIDCLEAN);
i_timer.SetInterval(sWorld->getIntConfig(CONFIG_INTERVAL_MAPUPDATE));
memset(i_GridStates, 0, sizeof(i_GridStates));
i_GridStateErrorCount = 0;
_nextInstanceId = 0;
}
MapManager::~MapManager() { }
+5 -2
View File
@@ -130,6 +130,9 @@ void MotionMaster::DirectClean(bool reset)
if (curr) DirectDelete(curr);
}
if (empty())
return;
if (needInitTop())
InitTop();
else if (reset)
@@ -156,7 +159,7 @@ void MotionMaster::DirectExpire(bool reset)
DirectDelete(curr);
}
while (!top())
while (!empty() && !top())
--_top;
if (empty())
@@ -176,7 +179,7 @@ void MotionMaster::DelayedExpire()
DelayedDelete(curr);
}
while (!top())
while (!empty() && !top())
--_top;
}
+20 -4
View File
@@ -87,13 +87,21 @@ class MotionMaster //: private std::stack<MovementGenerator *>
void pop()
{
if (empty())
return;
Impl[_top] = NULL;
while (!top())
while (!empty() && !top())
--_top;
}
void push(_Ty _Val) { ++_top; Impl[_top] = _Val; }
bool needInitTop() const { return _needInit[_top]; }
bool needInitTop() const
{
if (empty())
return false;
return _needInit[_top];
}
void InitTop();
public:
@@ -112,8 +120,16 @@ class MotionMaster //: private std::stack<MovementGenerator *>
bool empty() const { return (_top < 0); }
int size() const { return _top + 1; }
_Ty top() const { return Impl[_top]; }
_Ty GetMotionSlot(int slot) const { return Impl[slot]; }
_Ty top() const
{
ASSERT(!empty());
return Impl[_top];
}
_Ty GetMotionSlot(int slot) const
{
ASSERT(slot >= 0);
return Impl[slot];
}
void DirectDelete(_Ty curr);
void DelayedDelete(_Ty curr);
@@ -26,7 +26,7 @@ template<class T>
class ConfusedMovementGenerator : public MovementGeneratorMedium< T, ConfusedMovementGenerator<T> >
{
public:
explicit ConfusedMovementGenerator() : i_nextMoveTime(0) { }
explicit ConfusedMovementGenerator() : i_nextMoveTime(0), i_x(0), i_y(0), i_z(0) { }
void DoInitialize(T*);
void DoFinalize(T*);
@@ -37,7 +37,6 @@ class RandomMovementGenerator : public MovementGeneratorMedium< T, RandomMovemen
private:
TimeTrackerSmall i_nextMoveTime;
uint32 i_nextMove;
float wander_distance;
};
#endif
@@ -117,6 +117,10 @@ class FlightPathMovementGenerator : public MovementGeneratorMedium< Player, Flig
{
i_path = &pathnodes;
i_currentNode = startNode;
_endGridX = 0.0f;
_endGridY = 0.0f;
_endMapId = 0;
_preloadTargetNode = 0;
}
void DoInitialize(Player*);
void DoReset(Player*);
+1 -1
View File
@@ -231,7 +231,7 @@ void OutdoorPvP::DeleteSpawns()
m_capturePoints.clear();
}
OutdoorPvP::OutdoorPvP() : m_sendUpdate(true) { }
OutdoorPvP::OutdoorPvP() : m_TypeId(0), m_sendUpdate(true) { }
OutdoorPvP::~OutdoorPvP()
{
+3
View File
@@ -103,6 +103,7 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
m_muteTime(mute_time),
m_timeOutTime(0),
AntiDOS(this),
m_GUIDLow(0),
_player(NULL),
m_Socket(sock),
_security(sec),
@@ -126,6 +127,8 @@ WorldSession::WorldSession(uint32 id, WorldSocket* sock, AccountTypes sec, uint8
timeLastWhoCommand(0),
_RBACData(NULL)
{
memset(m_Tutorials, 0, sizeof(m_Tutorials));
if (sock)
{
m_Address = sock->GetRemoteAddress();
@@ -353,6 +353,7 @@ m_isRemoved(false), m_isSingleTarget(false), m_isUsingCharges(false)
m_duration = m_maxDuration;
m_procCharges = CalcMaxCharges(caster);
m_isUsingCharges = m_procCharges != 0;
memset(m_effects, 0, sizeof(m_effects));
// m_casterLevel = cast item level/caster level, caster level should be saved to db, confirmed with sniffs
}
+15
View File
@@ -72,12 +72,14 @@ SpellDestination::SpellDestination(float x, float y, float z, float orientation,
_position.Relocate(x, y, z, orientation);
_transportGUID = 0;
_position.m_mapId = mapId;
_transportOffset.Relocate(0, 0, 0, 0);
}
SpellDestination::SpellDestination(Position const& pos)
{
_position.Relocate(pos);
_transportGUID = 0;
_transportOffset.Relocate(0, 0, 0, 0);
}
SpellDestination::SpellDestination(WorldObject const& wObj)
@@ -504,6 +506,7 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
m_applyMultiplierMask = 0;
m_auraScaleMask = 0;
memset(m_damageMultipliers, 0, sizeof(m_damageMultipliers));
// Get data for type of attack
switch (m_spellInfo->DmgClass)
@@ -559,6 +562,16 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
unitTarget = NULL;
itemTarget = NULL;
gameObjTarget = NULL;
destTarget = NULL;
damage = 0;
effectHandleMode = SPELL_EFFECT_HANDLE_LAUNCH;
m_diminishLevel = DIMINISHING_LEVEL_1;
m_diminishGroup = DIMINISHING_NONE;
m_damage = 0;
m_healing = 0;
m_procAttacker = 0;
m_procVictim = 0;
m_procEx = 0;
focusObject = NULL;
m_cast_count = 0;
m_glyphIndex = 0;
@@ -574,6 +587,8 @@ m_caster((info->AttributesEx6 & SPELL_ATTR6_CAST_BY_CHARMER && caster->GetCharme
m_casttime = 0; // setup to correct value in Spell::prepare, must not be used before.
m_timer = 0; // will set to castime in prepare
m_immediateHandled = false;
m_channelTargetEffectMask = 0;
// Determine if spell can be reflected back to the caster
+1 -5
View File
@@ -5308,12 +5308,8 @@ void Spell::EffectQuestStart(SpellEffIndex effIndex)
Player* player = unitTarget->ToPlayer();
if (Quest const* qInfo = sObjectMgr->GetQuestTemplate(m_spellInfo->Effects[effIndex].MiscValue))
{
if (player->CanTakeQuest(qInfo, false) && player->CanAddQuest(qInfo, false))
{
player->AddQuest(qInfo, NULL);
}
}
player->AddQuestAndCheckCompletion(qInfo, NULL);
}
void Spell::EffectActivateRune(SpellEffIndex effIndex)
+4 -1
View File
@@ -258,7 +258,10 @@ public:
float DeltaScalingMultiplier;
float ComboScalingMultiplier;
SpellEffectInfo() { }
SpellEffectInfo() : _spellInfo(NULL), _effIndex(0), Effect(0), ApplyAuraName(0), Amplitude(0), DieSides(0),
RealPointsPerLevel(0), BasePoints(0), PointsPerComboPoint(0), ValueMultiplier(0), DamageMultiplier(0),
BonusMultiplier(0), MiscValue(0), MiscValueB(0), Mechanic(MECHANIC_NONE), RadiusEntry(NULL), ChainTarget(0),
ItemType(0), TriggerSpell(0), ImplicitTargetConditions(NULL) {}
SpellEffectInfo(SpellEntry const* spellEntry, SpellInfo const* spellInfo, uint8 effIndex, SpellEffectEntry const* effect);
bool IsEffect() const;
+5 -4
View File
@@ -3403,6 +3403,11 @@ void SpellMgr::LoadSpellInfoCorrections()
case 34471: // The Beast Within
spellInfo->AttributesEx5 |= SPELL_ATTR5_USABLE_WHILE_CONFUSED | SPELL_ATTR5_USABLE_WHILE_FEARED | SPELL_ATTR5_USABLE_WHILE_STUNNED;
break;
case 56606: // Ride Jokkum
case 61791: // Ride Vehicle (Yogg-Saron)
/// @todo: remove this when basepoints of all Ride Vehicle auras are calculated correctly
spellInfo->Effects[EFFECT_0].BasePoints = 1;
break;
// ULDUAR SPELLS
//
case 62374: // Pursued (Flame Leviathan)
@@ -3441,10 +3446,6 @@ void SpellMgr::LoadSpellInfoCorrections()
// that will be clear if we get more spells with problem like this
spellInfo->AttributesEx |= SPELL_ATTR1_DISPEL_AURAS_ON_IMMUNITY;
break;
case 61791: // Ride Vehicle (Yogg-Saron)
// TODO: remove this when basepoints of all Ride Vehicle auras are calculated correctly
spellInfo->Effects[EFFECT_0].BasePoints = 1;
break;
case 64468: // Empowering Shadows (Yogg-Saron)
case 64486: // Empowering Shadows (Yogg-Saron)
spellInfo->MaxAffectedTargets = 3; // same for both modes?
+1 -1
View File
@@ -60,7 +60,7 @@ class _SpellScript
virtual bool _Validate(SpellInfo const* entry);
public:
_SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE) { }
_SpellScript() : m_currentScriptState(SPELL_SCRIPT_STATE_NONE), m_scriptName(NULL), m_scriptSpellId(0) {}
virtual ~_SpellScript() { }
virtual void _Register();
virtual void _Unload();
+4 -2
View File
@@ -32,9 +32,11 @@ inline float GetAge(uint64 t) { return float(time(NULL) - t) / DAY; }
///////////////////////////////////////////////////////////////////////////////////////////////////
// GM ticket
GmTicket::GmTicket() { }
GmTicket::GmTicket() : _id(0), _playerGuid(0), _posX(0), _posY(0), _posZ(0), _mapId(0), _createTime(0), _lastModifiedTime(0),
_closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false),
_needResponse(false), _haveTicket(false) { }
GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _haveTicket(false)
GmTicket::GmTicket(Player* player, WorldPacket& recvData) : _createTime(time(NULL)), _lastModifiedTime(time(NULL)), _closedBy(0), _assignedTo(0), _completed(false), _escalatedStatus(TICKET_UNASSIGNED), _viewed(false), _haveTicket(false)
{
_id = sTicketMgr->GenerateTicketId();
_playerName = player->GetName();
+7 -1
View File
@@ -30,7 +30,13 @@
#include "Warden.h"
#include "AccountMgr.h"
Warden::Warden() : _inputCrypto(16), _outputCrypto(16), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0), _dataSent(false), _initialized(false) { }
Warden::Warden() : _session(NULL), _inputCrypto(16), _outputCrypto(16), _checkTimer(10000/*10 sec*/), _clientResponseTimer(0),
_dataSent(false), _previousTimestamp(0), _module(NULL), _initialized(false)
{
memset(_inputKey, 0, sizeof(_inputKey));
memset(_outputKey, 0, sizeof(_outputKey));
memset(_seed, 0, sizeof(_seed));
}
Warden::~Warden()
{
+1 -1
View File
@@ -34,7 +34,7 @@
#include "WardenCheckMgr.h"
#include "AccountMgr.h"
WardenWin::WardenWin() : Warden() { }
WardenWin::WardenWin() : Warden(), _serverTicks(0) {}
WardenWin::~WardenWin() { }
+12
View File
@@ -111,17 +111,29 @@ World::World()
m_MaxPlayerCount = 0;
m_NextDailyQuestReset = 0;
m_NextWeeklyQuestReset = 0;
m_NextMonthlyQuestReset = 0;
m_NextRandomBGReset = 0;
m_NextGuildReset = 0;
m_NextCurrencyReset = 0;
m_defaultDbcLocale = LOCALE_enUS;
m_availableDbcLocaleMask = 0;
mail_timer = 0;
mail_timer_expires = 0;
m_updateTime = 0;
m_updateTimeSum = 0;
m_updateTimeCount = 0;
m_currentTime = 0;
m_isClosed = false;
m_CleaningFlags = 0;
memset(rate_values, 0, sizeof(rate_values));
memset(m_int_configs, 0, sizeof(m_int_configs));
memset(m_bool_configs, 0, sizeof(m_bool_configs));
memset(m_float_configs, 0, sizeof(m_float_configs));
}
/// World destructor
+1 -1
View File
@@ -92,7 +92,7 @@ public:
// ok, normal (creature/GO starting) quest
if (player->CanAddQuest(quest, true))
{
player->AddQuest(quest, NULL);
player->AddQuestAndCheckCompletion(quest, NULL);
if (player->CanCompleteQuest(entry))
player->CompleteQuest(entry);
@@ -163,7 +163,8 @@ public:
## npc_brunnhildar_prisoner
######*/
enum BrunnhildarPrisoner {
enum BrunnhildarPrisoner
{
SPELL_ICE_PRISON = 54894,
SPELL_ICE_LANCE = 55046,
SPELL_FREE_PRISONER = 55048,
@@ -635,14 +636,13 @@ class spell_close_rift : public SpellScriptLoader
};
/*#####
# spell_jokkum_scriptcast
# Krolmir, Hammer of Storms
#####*/
enum JokkumScriptcast
{
SPELL_JOKKUM_KILL_CREDIT = 56545,
SPELL_JOKKUM_SUMMON = 56541,
SPELL_RIDE_JOKKUM = 56606,
NPC_KINGJOKKUM = 30331,
SAY_HOLD_ON = 0,
PATH_JOKKUM = 2072200
@@ -658,29 +658,15 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
bool Validate(SpellInfo const* /*spellInfo*/) OVERRIDE
{
if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_KILL_CREDIT) || !sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
if (!sSpellMgr->GetSpellInfo(SPELL_JOKKUM_SUMMON))
return false;
return true;
}
void OnApply(AuraEffect const* /*aurEff*/, AuraEffectHandleModes /*mode*/)
{
if (Player* player = GetTarget()->ToPlayer())
{
player->CastSpell(player, SPELL_JOKKUM_KILL_CREDIT, true);
player->CastSpell(player, SPELL_JOKKUM_SUMMON, true);
if (Creature* kingjokkum = GetClosestCreatureWithEntry(player, NPC_KINGJOKKUM, 10.0f))
{
kingjokkum->setFaction(player->getFaction());
player->CastSpell(kingjokkum, SPELL_RIDE_JOKKUM, true);
player->SetUInt64Value(PLAYER_FARSIGHT, player->GetGUID());
kingjokkum->AI()->Talk(0, player->GetGUID());
kingjokkum->ToPlayer()->SetClientControl(kingjokkum, 1);
kingjokkum->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
kingjokkum->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
}
}
Unit* target = GetTarget();
target->CastSpell(target, SPELL_JOKKUM_SUMMON, true);
}
void Register() OVERRIDE
@@ -695,6 +681,45 @@ class spell_jokkum_scriptcast : public SpellScriptLoader
}
};
class npc_king_jokkum_vehicle : public CreatureScript
{
public:
npc_king_jokkum_vehicle() : CreatureScript("npc_king_jokkum_vehicle") { }
struct npc_king_jokkum_vehicleAI : public VehicleAI
{
npc_king_jokkum_vehicleAI(Creature* creature) : VehicleAI(creature) { }
void OnCharmed(bool /*apply*/) OVERRIDE { }
void PassengerBoarded(Unit* who, int8 /*seat*/, bool apply) OVERRIDE
{
if (apply)
{
Talk(SAY_HOLD_ON, who->GetGUID());
me->CastSpell(who, SPELL_JOKKUM_KILL_CREDIT, true);
me->SetFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC);
me->GetMotionMaster()->MovePath(PATH_JOKKUM, false);
}
}
void MovementInform(uint32 type, uint32 id) OVERRIDE
{
if (type != WAYPOINT_MOTION_TYPE)
return;
// PointId in WaypointMovementGenerator doesn't match with PointId in DB
if (id == 19)
me->GetVehicleKit()->RemoveAllPassengers();
}
};
CreatureAI* GetAI(Creature* creature) const OVERRIDE
{
return new npc_king_jokkum_vehicleAI(creature);
}
};
void AddSC_storm_peaks()
{
new npc_injured_goblin();
@@ -706,4 +731,5 @@ void AddSC_storm_peaks()
new npc_brann_bronzebeard_keystone();
new spell_close_rift();
new spell_jokkum_scriptcast();
new npc_king_jokkum_vehicle();
}
+6 -1
View File
@@ -28,7 +28,12 @@
class BasicEvent
{
public:
BasicEvent() { to_Abort = false; }
BasicEvent()
{
to_Abort = false;
m_addTime = 0;
m_execTime = 0;
}
virtual ~BasicEvent() { } // override destructor to perform some actions on event removal
// this method executes when the event is triggered