*Move summon water elemental handler to correct place.

--HG--
branch : trunk
This commit is contained in:
QAston
2010-02-20 20:28:31 +01:00
45 changed files with 50623 additions and 49317 deletions
+1 -1
View File
@@ -64,4 +64,4 @@ footman, elron103, make_the_king, destros, MetaphysicalDrama, disassebler,
Malcrom, Vladmimír Lipták, retriman, hyriuu, Smakapotatis, PainKiller, Malcrom, Vladmimír Lipták, retriman, hyriuu, Smakapotatis, PainKiller,
bkhorizon, n0n4m3, Chesterfield, Frankir, Wowka321, Morpheux, p0wer, bkhorizon, n0n4m3, Chesterfield, Frankir, Wowka321, Morpheux, p0wer,
Ouden, toshik, laise, yavi, Splinter, Syntec, Arthas, denyde, unholy, Ouden, toshik, laise, yavi, Splinter, Syntec, Arthas, denyde, unholy,
Vaughner, blackmanos, edrinn. Vaughner, blackmanos, edrinn, Supabad.
+5
View File
@@ -397,6 +397,8 @@ UPDATE `creature_template` SET `ScriptName`='npc_imprisoned_beryl_sorcerer' WHER
UPDATE `creature_template` SET `ScriptName`='npc_mootoo_the_younger' WHERE `entry`= 25504; UPDATE `creature_template` SET `ScriptName`='npc_mootoo_the_younger' WHERE `entry`= 25504;
UPDATE `creature_template` SET `ScriptName`='npc_bonker_togglevolt' WHERE `entry`= 25589; UPDATE `creature_template` SET `ScriptName`='npc_bonker_togglevolt' WHERE `entry`= 25589;
UPDATE `creature_template` SET `ScriptName`='npc_fezzix_geartwist' WHERE `entry`=25849; UPDATE `creature_template` SET `ScriptName`='npc_fezzix_geartwist' WHERE `entry`=25849;
UPDATE `creature_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850;
UPDATE `item_template` SET `scriptname`='item_dehta_trap_smasher' WHERE `entry`=35228;
/* BURNING STEPPES */ /* BURNING STEPPES */
UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563; UPDATE `creature_template` SET `ScriptName`='npc_ragged_john' WHERE `entry`=9563;
@@ -911,6 +913,9 @@ UPDATE `gameobject_template` SET `ScriptName`='go_blood_filled_orb' WHERE `entry
/* RAZORFEN DOWNS */ /* RAZORFEN DOWNS */
UPDATE `creature_template` SET `ScriptName`='boss_amnennar_the_coldbringer' WHERE `entry`=7358; UPDATE `creature_template` SET `ScriptName`='boss_amnennar_the_coldbringer' WHERE `entry`=7358;
UPDATE `creature_template` SET `ScriptName`='npc_henry_stern' WHERE `entry`=8696; UPDATE `creature_template` SET `ScriptName`='npc_henry_stern' WHERE `entry`=8696;
UPDATE `creature_template` SET `ScriptName`='npc_tomb_creature' WHERE `entry` IN (7351,7349);
UPDATE `instance_template` SET `script`='instance_razorfen_downs' WHERE `map`=129;
UPDATE `gameobject_template` SET `ScriptName`='go_gong' WHERE `entry`=148917;
/* RAZORFEN KRAUL */ /* RAZORFEN KRAUL */
UPDATE `creature_template` SET `Scriptname`='npc_willix' WHERE `entry`=4508; UPDATE `creature_template` SET `Scriptname`='npc_willix' WHERE `entry`=4508;
@@ -1,2 +1,3 @@
-- Summon Water Elemental -- Summon Water Elemental
INSERT INTO `spell_linked_spell`(`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES (31687, 70907, 0,'Summon Water Elemental'); DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=31687 AND `spell_effect`=70907;
INSERT INTO `spell_linked_spell` (`spell_trigger`,`spell_effect`,`type`,`comment`) VALUES (31687, 70907, 0,'Summon Water Elemental');
@@ -1 +0,0 @@
DELETE FROM spell_linked_spell WHERE spell_trigger = 31687;
@@ -0,0 +1,2 @@
-- Remove hack for glyph of Eternal Water
DELETE FROM `spell_linked_spell` WHERE `spell_trigger`=31687 AND `spell_effect`=70907;
+2
View File
@@ -0,0 +1,2 @@
UPDATE `creature_template` SET `scriptname`='npc_trapped_mammoth_calf' WHERE `entry`=25850;
UPDATE `item_template` SET `scriptname`='item_dehta_trap_smasher' WHERE `entry`=35228;
+2
View File
@@ -0,0 +1,2 @@
UPDATE `gameobject_template` SET `scriptname`='go_tadpole_cage' WHERE `entry`=187373;
+15
View File
@@ -0,0 +1,15 @@
DELETE FROM `script_texts` WHERE `npc_entry`=26588;
INSERT INTO `script_texts` (`npc_entry`, `entry`, `content_default`, `content_loc1`, `content_loc2`, `content_loc3`, `content_loc4`, `content_loc5`, `content_loc6`, `content_loc7`, `content_loc8`, `sound`, `type`, `language`, `emote`, `comment`) VALUES
(26588, -1800013, 'Thank you for helping me get back to the camp. Go tell Walter that I''m safe now!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800012, 'Are you ready, Mr. Floppy? Stay close to me and watch out for those wolves!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800011, 'The Ravenous Worg chomps down on Mr. Floppy', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 4, 0, 0, '12027'),
(26588, -1800010, 'Mr. Floppy revives', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 4, 0, 0, '12027'),
(26588, -1800009, 'I think I see the camp! We''re almost home, Mr. Floppy! Let''s go!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800008, 'Mr. Floppy, you''re ok! Thank you so much for saving Mr. Floppy!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800007, 'Don''t go toward the light, Mr. Floppy!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800006, 'Let''s get out of here before more wolves find us!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800005, 'There''s a big meanie attacking Mr. Floppy! Help! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800004, 'He''s gonna eat Mr. Floppy! You gotta help Mr. Floppy! You just gotta!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800003, 'Oh, no! Look, it''s another wolf, and it''s a biiiiiig one!', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800002, 'He''s going for Mr. Floppy! ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027'),
(26588, -1800001, 'Um... I think one of those wolves is back...', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 0, 0, 0, 0, '12027');
@@ -0,0 +1,29 @@
DELETE FROM `script_waypoint` wHERE `entry`=26588;
INSERT INTO `script_waypoint` (`entry`, `pointid`, `location_x`, `location_y`, `location_z`, `waittime`, `point_comment`) VALUES
(26588, 1, 4333.18, -3688.4, 263.857, 0, '0'),
(26588, 2, 4341.38, -3683.77, 257.422, 0, '0'),
(26588, 3, 4342.67, -3683.21, 257.218, 0, '0'),
(26588, 4, 4346.22, -3688.72, 257.065, 0, '0'),
(26588, 5, 4343.8, -3695.27, 257.124, 0, '0'),
(26588, 6, 4337.74, -3707.2, 257.628, 0, '0'),
(26588, 7, 4317.58, -3722.8, 256.941, 0, '0'),
(26588, 8, 4306.64, -3736.46, 258.304, 0, '0'),
(26588, 9, 4299.96, -3760.02, 254.959, 0, '0'),
(26588, 10, 4294.21, -3777.34, 249.139, 1000, '0'),
(26588, 11, 4294.37, -3776.97, 249.259, 10000, '0'),
(26588, 12, 4300.22, -3794.61, 240.107, 2000, '0'),
(26588, 13, 4307.25, -3817.76, 231.414, 2000, '0'),
(26588, 14, 4326.31, -3883.31, 208.457, 2000, '0'),
(26588, 15, 4346.19, -3905.41, 198.805, 2000, '0'),
(26588, 16, 4347.39, -3916.43, 196.716, 5000, '0'),
(26588, 17, 4350.17, -3935.03, 191.824, 1000, '0'),
(26588, 18, 4347.24, -3939.54, 191.445, 2000, '0'),
(26588, 19, 4347.24, -3939.54, 191.445, 2000, '0'),
(26588, 20, 4347.24, -3939.54, 191.445, 5000, '0'),
(26588, 21, 4347.24, -3939.54, 191.445, 7000, '0'),
(26588, 22, 4347.24, -3939.54, 191.445, 5000, '0'),
(26588, 23, 4347.24, -3939.54, 191.445, 5000, '0'),
(26588, 24, 4347.24, -3939.54, 191.445, 0, '0'),
(26588, 25, 4353.72, -3965.61, 190.154, 0, '0'),
(26588, 26, 4363.12, -3995.61, 183.327, 0, '0'),
(26588, 27, 4371.99, -4010.97, 181.33, 0, '0');
+2
View File
@@ -0,0 +1,2 @@
UPDATE `creature_template` SET `ScriptName` = 'npc_emily' WHERE `entry`=26588;
UPDATE `creature_template` SET `ScriptName` = 'npc_mrfloppy' WHERE `entry`=26589;
+4
View File
@@ -0,0 +1,4 @@
UPDATE `gameobject_template` SET `ScriptName`='go_gong' WHERE `entry`=148917;
UPDATE `creature_template` SET `ScriptName`='npc_tomb_creature' WHERE `entry` IN (7351,7349);
UPDATE `instance_template` SET `script`='instance_razorfen_downs' WHERE `map`=129;
@@ -0,0 +1,17 @@
-- Some spell bonus data mostly for DK spells and trinket spells
DELETE FROM `spell_bonus_data` WHERE `entry` IN (63544,54181,55078,55095,50536,52212,51460,48721,45477,54757,45055,60203,60488,45429);
INSERT INTO `spell_bonus_data` (`entry`, `direct_bonus`, `dot_bonus`, `ap_bonus`, `ap_dot_bonus`, `comments`) VALUES
(63544, 0, -1, -1, -1, 'Priest - Empowered Renew'),
(54181, 0, -1, -1, -1, 'Warlock - Fel Synergy'),
(55078, 0, 0, -1, 0.06325, 'Death Knight - Blood Plague'),
(55095, -1, 0, -1, 0.06325, 'Death Knight - Frost Fever'),
(50536, -1, 0, -1, -1, 'Death Knight - Unholy Blight (Rank 1)'),
(52212, 0, -1, 0.0475, -1, 'Death Knight - Death and Decay'),
(51460, 0, -1, -1, -1, 'Death Knight - Necrosis'),
(48721, 0, -1, 0.04, -1, 'Death Knight - Blood Boil'),
(45477, 0, -1, 0.1, -1, 'Death Knight - Icy Touch'),
(54757, 0, -1, -1, -1, 'Hand-Mounted Pyro Rocket - Pyro Rocket'),
(45055, 0, -1, -1, -1, 'Timbal\'s Focusing Crystal - Shadow Bolt'),
(60203, 0, -1, -1, -1, 'Darkmoon Card: Death'),
(60488, 0, -1, -1, -1, 'Extract of Necromatic Power'),
(45429, 0, -1, -1, -1, 'Shattered Sun Pendant of Acumen - Arcane Bolt');
+81 -69
View File
@@ -176,85 +176,91 @@ bool ArenaTeam::AddMember(const uint64& PlayerGuid)
return true; return true;
} }
bool ArenaTeam::LoadArenaTeamFromDB(uint32 ArenaTeamId) bool ArenaTeam::LoadArenaTeamFromDB(QueryResult_AutoPtr arenaTeamDataResult)
{ {
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT arenateamid,name,captainguid,type,BackgroundColor,EmblemStyle,EmblemColor,BorderStyle,BorderColor FROM arena_team WHERE arenateamid = '%u'", ArenaTeamId); if(!arenaTeamDataResult)
if(!result)
return false; return false;
Field *fields = result->Fetch(); Field *fields = arenaTeamDataResult->Fetch();
m_TeamId = fields[0].GetUInt32(); m_TeamId = fields[0].GetUInt32();
m_Name = fields[1].GetCppString(); m_Name = fields[1].GetCppString();
m_CaptainGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER); m_CaptainGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER);
m_Type = fields[3].GetUInt32(); m_Type = fields[3].GetUInt32();
m_BackgroundColor = fields[4].GetUInt32(); m_BackgroundColor = fields[4].GetUInt32();
m_EmblemStyle = fields[5].GetUInt32(); m_EmblemStyle = fields[5].GetUInt32();
m_EmblemColor = fields[6].GetUInt32(); m_EmblemColor = fields[6].GetUInt32();
m_BorderStyle = fields[7].GetUInt32(); m_BorderStyle = fields[7].GetUInt32();
m_BorderColor = fields[8].GetUInt32(); m_BorderColor = fields[8].GetUInt32();
//load team stats
// only load here, so additional checks can be made m_stats.rating = fields[9].GetUInt32();
LoadStatsFromDB(ArenaTeamId); m_stats.games_week = fields[10].GetUInt32();
LoadMembersFromDB(ArenaTeamId); m_stats.wins_week = fields[11].GetUInt32();
m_stats.games_season = fields[12].GetUInt32();
if(Empty()) m_stats.wins_season = fields[13].GetUInt32();
{ m_stats.rank = fields[14].GetUInt32();
// arena team is empty, delete from db
CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", ArenaTeamId);
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", ArenaTeamId);
CharacterDatabase.PExecute("DELETE FROM arena_team_stats WHERE arenateamid = '%u'", ArenaTeamId);
CharacterDatabase.CommitTransaction();
return false;
}
return true; return true;
} }
void ArenaTeam::LoadStatsFromDB(uint32 ArenaTeamId) bool ArenaTeam::LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult)
{ {
// 0 1 2 3 4 5 if(!arenaTeamMembersResult)
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT rating,games,wins,played,wins2,rank FROM arena_team_stats WHERE arenateamid = '%u'", ArenaTeamId); return false;
if(!result) bool captainPresentInTeam = false;
return;
Field *fields = result->Fetch();
m_stats.rating = fields[0].GetUInt32();
m_stats.games_week = fields[1].GetUInt32();
m_stats.wins_week = fields[2].GetUInt32();
m_stats.games_season = fields[3].GetUInt32();
m_stats.wins_season = fields[4].GetUInt32();
m_stats.rank = fields[5].GetUInt32();
}
void ArenaTeam::LoadMembersFromDB(uint32 ArenaTeamId)
{
// 0 1 2 3 4 5 6 7
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT member.guid,played_week,wons_week,played_season,wons_season,personal_rating,name,class "
"FROM arena_team_member member "
"INNER JOIN characters chars on member.guid = chars.guid "
"WHERE member.arenateamid = '%u'", ArenaTeamId);
if(!result)
return;
do do
{ {
Field *fields = result->Fetch(); Field *fields = arenaTeamMembersResult->Fetch();
//prevent crash if db records are broken, when all members in result are already processed and current team hasn't got any members
if (!fields)
break;
uint32 arenaTeamId = fields[0].GetUInt32();
if (arenaTeamId < m_TeamId)
{
//there is in table arena_team_member record which doesn't have arenateamid in arena_team table, report error
sLog.outErrorDb("ArenaTeam %u does not exist but it has record in arena_team_member table, deleting it!", arenaTeamId);
CharacterDatabase.PExecute("DELETE FROM arena_team_member WHERE arenateamid = '%u'", arenaTeamId);
continue;
}
if (arenaTeamId > m_TeamId)
//we loaded all members for this arena_team already, break cycle
break;
ArenaTeamMember newmember; ArenaTeamMember newmember;
newmember.guid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); newmember.guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
newmember.games_week = fields[1].GetUInt32(); newmember.games_week = fields[2].GetUInt32();
newmember.wins_week = fields[2].GetUInt32(); newmember.wins_week = fields[3].GetUInt32();
newmember.games_season = fields[3].GetUInt32(); newmember.games_season = fields[4].GetUInt32();
newmember.wins_season = fields[4].GetUInt32(); newmember.wins_season = fields[5].GetUInt32();
newmember.personal_rating = fields[5].GetUInt32(); newmember.personal_rating = fields[6].GetUInt32();
newmember.name = fields[6].GetCppString(); newmember.name = fields[7].GetCppString();
newmember.Class = fields[7].GetUInt8(); newmember.Class = fields[8].GetUInt8();
//check if member exists in characters table
if (newmember.name.empty())
{
sLog.outErrorDb("ArenaTeam %u has member with empty name - probably player %u doesn't exist, deleting him from memberlist!", arenaTeamId, GUID_LOPART(newmember.guid));
this->DelMember(newmember.guid);
continue;
}
if (newmember.guid == GetCaptain())
captainPresentInTeam = true;
m_members.push_back(newmember); m_members.push_back(newmember);
}while( result->NextRow() ); }while (arenaTeamMembersResult->NextRow());
if(Empty() || !captainPresentInTeam)
{
// arena team is empty or captain is not in team, delete from db
sLog.outErrorDb("ArenaTeam %u does not have any members or its captain is not in team, disbanding it...", m_TeamId);
return false;
}
return true;
} }
void ArenaTeam::SetCaptain(const uint64& guid) void ArenaTeam::SetCaptain(const uint64& guid)
@@ -304,9 +310,12 @@ void ArenaTeam::DelMember(uint64 guid)
void ArenaTeam::Disband(WorldSession *session) void ArenaTeam::Disband(WorldSession *session)
{ {
// event // event
WorldPacket data; if (session)
session->BuildArenaTeamEventPacket(&data, ERR_ARENA_TEAM_DISBANDED_S, 2, session->GetPlayerName(), GetName(), ""); {
BroadcastPacket(&data); WorldPacket data;
session->BuildArenaTeamEventPacket(&data, ERR_ARENA_TEAM_DISBANDED_S, 2, session->GetPlayerName(), GetName(), "");
BroadcastPacket(&data);
}
while (!m_members.empty()) while (!m_members.empty())
{ {
@@ -314,8 +323,11 @@ void ArenaTeam::Disband(WorldSession *session)
DelMember(m_members.front().guid); DelMember(m_members.front().guid);
} }
if(Player *player = session->GetPlayer()) if (session)
sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId()); {
if(Player *player = session->GetPlayer())
sLog.outArena("Player: %s [GUID: %u] disbanded arena team type: %u [Id: %u].", player->GetName(), player->GetGUIDLow(), GetType(), GetId());
}
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", m_TeamId); CharacterDatabase.PExecute("DELETE FROM arena_team WHERE arenateamid = '%u'", m_TeamId);
+2 -2
View File
@@ -173,8 +173,8 @@ class ArenaTeam
bool IsFighting() const; bool IsFighting() const;
bool LoadArenaTeamFromDB(uint32 ArenaTeamId); bool LoadArenaTeamFromDB(QueryResult_AutoPtr arenaTeamDataResult);
void LoadMembersFromDB(uint32 ArenaTeamId); bool LoadMembersFromDB(QueryResult_AutoPtr arenaTeamMembersResult);
void LoadStatsFromDB(uint32 ArenaTeamId); void LoadStatsFromDB(uint32 ArenaTeamId);
void SaveToDB(); void SaveToDB();
+3 -29
View File
@@ -24,24 +24,9 @@
#include "ObjectMgr.h" #include "ObjectMgr.h"
#include "WorldPacket.h" #include "WorldPacket.h"
/*
The crap needs shitload of DB data fixed, will paste it here:
Cannons:
update creature_template set IconName = "Gunner" where entry = 27894;
UPDATE `creature_template` SET `vehicleid`=160 WHERE `entry`=27894;
^^ Sniffed by el manuel, should be good.
UPDATE `creature_template` SET `spell1`=49872 WHERE `entry`=27894;
UPDATE `creature_template` set `unit_flags`=`unit_flags`|4 WHERE `entry`=27894;
UPDATE `creature_template` SET `vehicleid`=158 WHERE `entry`=28781;
UPDATE `creature_template` set `spell1=49872 where `entry`=32795;
UPDATE `creature_template` set `spell1=52338,`spell2`=60206 where `entry`=32796;
*/
BattleGroundSA::BattleGroundSA() BattleGroundSA::BattleGroundSA()
{ {
//TODO FIX ME!
m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_SA_START_TWO_MINUTES; m_StartMessageIds[BG_STARTING_EVENT_FIRST] = LANG_BG_SA_START_TWO_MINUTES;
m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_SA_START_ONE_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_SECOND] = LANG_BG_SA_START_ONE_MINUTE;
m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_SA_START_HALF_MINUTE; m_StartMessageIds[BG_STARTING_EVENT_THIRD] = LANG_BG_SA_START_HALF_MINUTE;
@@ -53,7 +38,7 @@ BattleGroundSA::BattleGroundSA()
BattleGroundSA::~BattleGroundSA() BattleGroundSA::~BattleGroundSA()
{ {
sLog.outError("SOTA ZDYCHA: \n%u %u\n %u %u",BG_SA_MAXOBJ,m_BgObjects.size(),BG_SA_MAXNPC,m_BgCreatures.size());
} }
void BattleGroundSA::Reset() void BattleGroundSA::Reset()
@@ -79,7 +64,7 @@ bool BattleGroundSA::ResetObjs()
uint32 atF = BG_SA_Factions[attackers]; uint32 atF = BG_SA_Factions[attackers];
uint32 defF = BG_SA_Factions[attackers ? TEAM_ALLIANCE : TEAM_HORDE]; uint32 defF = BG_SA_Factions[attackers ? TEAM_ALLIANCE : TEAM_HORDE];
sLog.outError("SOTA: Attacking team: %u %u %u",attackers,atF,defF);
for(uint8 i = 0; i <BG_SA_MAXOBJ; i++) for(uint8 i = 0; i <BG_SA_MAXOBJ; i++)
DelObject(i); DelObject(i);
@@ -100,8 +85,7 @@ bool BattleGroundSA::ResetObjs()
BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3], BG_SA_ObjSpawnlocs[i][2],BG_SA_ObjSpawnlocs[i][3],
0,0,0,0,RESPAWN_ONE_DAY)) 0,0,0,0,RESPAWN_ONE_DAY))
return false; return false;
else
sLog.outError("SOTA: object %u spawned",i);
} }
GetBGObject(BG_SA_TITAN_RELIC)->SetUInt32Value(GAMEOBJECT_FACTION, defF); GetBGObject(BG_SA_TITAN_RELIC)->SetUInt32Value(GAMEOBJECT_FACTION, defF);
@@ -159,7 +143,6 @@ bool BattleGroundSA::ResetObjs()
else else
{ {
GraveyardStatus[i] = ((attackers == TEAM_HORDE )? TEAM_ALLIANCE : TEAM_HORDE); GraveyardStatus[i] = ((attackers == TEAM_HORDE )? TEAM_ALLIANCE : TEAM_HORDE);
sLog.outError("SOTA: Spawning GY %u %f %f %f team %u",i,sg->x,sg->y,sg->z,GraveyardStatus[i]);
if(!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((attackers == TEAM_HORDE )? ALLIANCE : HORDE) )) if(!AddSpiritGuide(i + BG_SA_MAXNPC, sg->x, sg->y, sg->z, BG_SA_GYOrientation[i], ((attackers == TEAM_HORDE )? ALLIANCE : HORDE) ))
{ {
sLog.outError("SOTA: couldn't spawn GY: %u",i); sLog.outError("SOTA: couldn't spawn GY: %u",i);
@@ -231,7 +214,6 @@ void BattleGroundSA::StartShips()
{ {
if(ShipsStarted) if(ShipsStarted)
return; return;
sLog.outError("SOTA: Starting boats!");
DoorOpen(BG_SA_BOAT_ONE); DoorOpen(BG_SA_BOAT_ONE);
DoorOpen(BG_SA_BOAT_TWO); DoorOpen(BG_SA_BOAT_TWO);
@@ -322,9 +304,6 @@ void BattleGroundSA::FillInitialWorldStates(WorldPacket& data)
uint32 ally_attacks = uint32(attackers == TEAM_ALLIANCE ? 1 : 0); uint32 ally_attacks = uint32(attackers == TEAM_ALLIANCE ? 1 : 0);
uint32 horde_attacks = uint32(attackers == TEAM_HORDE ? 1 : 0); uint32 horde_attacks = uint32(attackers == TEAM_HORDE ? 1 : 0);
for(uint8 i = 0; i < BG_SA_MAX_GY; i++)
sLog.outError("UWS: %u",GraveyardStatus[i]);
data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]); data << uint32(BG_SA_ANCIENT_GATEWS) << uint32(GateStatus[BG_SA_ANCIENT_GATE]);
data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]); data << uint32(BG_SA_YELLOW_GATEWS) << uint32(GateStatus[BG_SA_YELLOW_GATE]);
data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]); data << uint32(BG_SA_GREEN_GATEWS) << uint32(GateStatus[BG_SA_GREEN_GATE]);
@@ -441,7 +420,6 @@ void BattleGroundSA::TeleportPlayers()
void BattleGroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint32 event) void BattleGroundSA::EventPlayerDamagedGO(Player* plr, GameObject* go, uint32 event)
{ {
sLog.outError("SOTA: EventGO %u",event);
switch(event) switch(event)
{ {
@@ -540,7 +518,6 @@ void BattleGroundSA::DestroyGate(uint32 i, Player* pl)
if(i < 5) if(i < 5)
DelObject(i+9); DelObject(i+9);
sLog.outError("SOTA: gate %u destroyed!",i+1);
UpdateWorldState(uws, GateStatus[i]); UpdateWorldState(uws, GateStatus[i]);
UpdatePlayerScore(pl,SCORE_DESTROYED_WALL, 1); UpdatePlayerScore(pl,SCORE_DESTROYED_WALL, 1);
} }
@@ -625,7 +602,6 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i)
switch(i) switch(i)
{ {
case BG_SA_LEFT_CAPTURABLE_GY: case BG_SA_LEFT_CAPTURABLE_GY:
sLog.outError("LEFT GY");
SpawnBGObject(BG_SA_LEFT_FLAG,RESPAWN_ONE_DAY); SpawnBGObject(BG_SA_LEFT_FLAG,RESPAWN_ONE_DAY);
npc = BG_SA_NPC_RIGSPARK; npc = BG_SA_NPC_RIGSPARK;
AddCreature(BG_SA_NpcEntries[npc], npc, attackers, AddCreature(BG_SA_NpcEntries[npc], npc, attackers,
@@ -635,7 +611,6 @@ void BattleGroundSA::CaptureGraveyard(BG_SA_Graveyards i)
UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1)); UpdateWorldState(BG_SA_LEFT_GY_HORDE, (GraveyardStatus[i] == TEAM_ALLIANCE? 0:1));
break; break;
case BG_SA_RIGHT_CAPTURABLE_GY: case BG_SA_RIGHT_CAPTURABLE_GY:
sLog.outError("RIGHT GY");
SpawnBGObject(BG_SA_RIGHT_FLAG, RESPAWN_ONE_DAY); SpawnBGObject(BG_SA_RIGHT_FLAG, RESPAWN_ONE_DAY);
npc = BG_SA_NPC_SPARKLIGHT; npc = BG_SA_NPC_SPARKLIGHT;
AddCreature(BG_SA_NpcEntries[npc], npc, attackers, AddCreature(BG_SA_NpcEntries[npc], npc, attackers,
@@ -662,7 +637,6 @@ void BattleGroundSA::EventPlayerUsedGO(Player* Source, GameObject* object)
if(object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC]) if(object->GetEntry() == BG_SA_ObjEntries[BG_SA_TITAN_RELIC])
{ {
sLog.outError("SOTA: Match ended.");
if(Source->GetTeamId() == attackers) if(Source->GetTeamId() == attackers)
{ {
+1 -1
View File
@@ -815,7 +815,7 @@ bool Creature::isCanTrainingOf(Player* pPlayer, bool msg) const
TrainerSpellData const* trainer_spells = GetTrainerSpells(); TrainerSpellData const* trainer_spells = GetTrainerSpells();
if(!trainer_spells || trainer_spells->spellList.empty()) if((!trainer_spells || trainer_spells->spellList.empty()) && GetCreatureInfo()->trainer_type != TRAINER_TYPE_PETS)
{ {
sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.", sLog.outErrorDb("Creature %u (Entry: %u) have UNIT_NPC_FLAG_TRAINER but have empty trainer spell list.",
GetGUIDLow(),GetEntry()); GetGUIDLow(),GetEntry());
+1 -1
View File
@@ -218,7 +218,7 @@ void LoadDBCStores(const std::string& dataPath)
{ {
std::string dbcPath = dataPath+"dbc/"; std::string dbcPath = dataPath+"dbc/";
const uint32 DBCFilesCount = 84; const uint32 DBCFilesCount = 85;
barGoLink bar(DBCFilesCount); barGoLink bar(DBCFilesCount);
+112 -99
View File
@@ -207,59 +207,43 @@ void Guild::SetGINFO(std::string ginfo)
CharacterDatabase.PExecute("UPDATE guild SET info='%s' WHERE guildid='%u'", ginfo.c_str(), m_Id); CharacterDatabase.PExecute("UPDATE guild SET info='%s' WHERE guildid='%u'", ginfo.c_str(), m_Id);
} }
bool Guild::LoadGuildFromDB(uint32 GuildId) bool Guild::LoadGuildFromDB(QueryResult_AutoPtr guildDataResult)
{ {
//set m_Id in case guild data are broken in DB and Guild will be Disbanded (deleted from DB) if (!guildDataResult)
m_Id = GuildId;
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT COUNT(TabId) FROM guild_bank_tab WHERE guildid='%u'", GuildId);
if (result)
{
Field *fields = result->Fetch();
m_PurchasedTabs = fields[0].GetUInt32();
if (m_PurchasedTabs > GUILD_BANK_MAX_TABS)
m_PurchasedTabs = GUILD_BANK_MAX_TABS;
}
if (!LoadRanksFromDB(GuildId))
return false; return false;
if (!LoadMembersFromDB(GuildId)) Field *fields = guildDataResult->Fetch();
return false;
LoadBankRightsFromDB(GuildId); // Must be after LoadRanksFromDB because it populates rank struct m_Id = fields[0].GetUInt32();
m_Name = fields[1].GetCppString();
m_LeaderGuid = MAKE_NEW_GUID(fields[2].GetUInt32(), 0, HIGHGUID_PLAYER);
m_EmblemStyle = fields[3].GetUInt32();
m_EmblemColor = fields[4].GetUInt32();
m_BorderStyle = fields[5].GetUInt32();
m_BorderColor = fields[6].GetUInt32();
m_BackgroundColor = fields[7].GetUInt32();
GINFO = fields[8].GetCppString();
MOTD = fields[9].GetCppString();
time_t time = fields[10].GetUInt64();
m_GuildBankMoney = fields[11].GetUInt64();
m_PurchasedTabs = fields[12].GetUInt32();
// 0 1 2 3 4 5 if (m_PurchasedTabs > GUILD_BANK_MAX_TABS)
result = CharacterDatabase.PQuery("SELECT name, leaderguid, EmblemStyle, EmblemColor, BorderStyle, BorderColor," m_PurchasedTabs = GUILD_BANK_MAX_TABS;
// 6 7 8 9 10
"BackgroundColor, info, motd, createdate, BankMoney FROM guild WHERE guildid = '%u'", GuildId);
if (!result)
return false;
Field *fields = result->Fetch();
m_Name = fields[0].GetCppString();
m_LeaderGuid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
m_EmblemStyle = fields[2].GetUInt32();
m_EmblemColor = fields[3].GetUInt32();
m_BorderStyle = fields[4].GetUInt32();
m_BorderColor = fields[5].GetUInt32();
m_BackgroundColor = fields[6].GetUInt32();
GINFO = fields[7].GetCppString();
MOTD = fields[8].GetCppString();
time_t time = fields[9].GetUInt64();
m_GuildBankMoney = fields[10].GetUInt64();
if (time > 0) if (time > 0)
{ {
tm local = *(localtime(&time)); // dereference and assign tm local = *(localtime(&time)); // dereference and assign
m_CreatedDay = local.tm_mday; m_CreatedDay = local.tm_mday;
m_CreatedMonth = local.tm_mon + 1; m_CreatedMonth = local.tm_mon + 1;
m_CreatedYear = local.tm_year + 1900; m_CreatedYear = local.tm_year + 1900;
} }
return true;
}
bool Guild::CheckGuildStructure()
{
// Repair the structure of guild // Repair the structure of guild
// If the guildmaster doesn't exist or isn't the member of guild // If the guildmaster doesn't exist or isn't the member of guild
// attempt to promote another member // attempt to promote another member
@@ -280,24 +264,19 @@ bool Guild::LoadGuildFromDB(uint32 GuildId)
if (itr->second.RankId == GR_GUILDMASTER && GUID_LOPART(m_LeaderGuid) != itr->first) // Allow only 1 guildmaster if (itr->second.RankId == GR_GUILDMASTER && GUID_LOPART(m_LeaderGuid) != itr->first) // Allow only 1 guildmaster
ChangeRank(itr->first, GR_OFFICER); // set right of member to officer ChangeRank(itr->first, GR_OFFICER); // set right of member to officer
sLog.outDebug("Guild %u Creation time Loaded day: %u, month: %u, year: %u", GuildId, m_CreatedDay, m_CreatedMonth, m_CreatedYear);
return true; return true;
} }
bool Guild::LoadRanksFromDB(uint32 GuildId) bool Guild::LoadRanksFromDB(QueryResult_AutoPtr guildRanksResult)
{ {
Field *fields; if (!guildRanksResult)
// 0 1 2 3
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT rid,rname,rights,BankMoneyPerDay FROM guild_rank WHERE guildid = '%u' ORDER BY rid ASC", GuildId);
if (!result)
{ {
sLog.outError("Guild %u has broken `guild_rank` data, creating new...",GuildId); sLog.outError("Guild %u has broken `guild_rank` data, creating new...",m_Id);
CreateDefaultGuildRanks(0); CreateDefaultGuildRanks(0);
return true; return true;
} }
Field *fields;
bool broken_ranks = false; bool broken_ranks = false;
//GUILD RANKS are sequence starting from 0 = GUILD_MASTER (ALL PRIVILEGES) to max 9 (lowest privileges) //GUILD RANKS are sequence starting from 0 = GUILD_MASTER (ALL PRIVILEGES) to max 9 (lowest privileges)
@@ -307,12 +286,27 @@ bool Guild::LoadRanksFromDB(uint32 GuildId)
do do
{ {
fields = result->Fetch(); fields = guildRanksResult->Fetch();
//condition that would be true when all ranks in QueryResult will be processed and guild without ranks is being processed
if (!fields)
break;
uint32 rankID = fields[0].GetUInt32(); uint32 guildId = fields[0].GetUInt32();
std::string rankName = fields[1].GetCppString(); if (guildId < m_Id)
uint32 rankRights = fields[2].GetUInt32(); {
uint32 rankMoney = fields[3].GetUInt32(); //there is in table guild_rank record which doesn't have guildid in guild table, report error
sLog.outErrorDb("Guild %u does not exist but it has a record in guild_rank table, deleting it!", guildId);
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid = '%u'", guildId);
continue;
}
if (guildId > m_Id)
//we loaded all ranks for this guild already, break cycle
break;
uint32 rankID = fields[1].GetUInt32();
std::string rankName = fields[2].GetCppString();
uint32 rankRights = fields[3].GetUInt32();
uint32 rankMoney = fields[4].GetUInt32();
if (rankID != m_Ranks.size()) // guild_rank.ids are sequence 0,1,2,3.. if (rankID != m_Ranks.size()) // guild_rank.ids are sequence 0,1,2,3..
broken_ranks = true; broken_ranks = true;
@@ -322,27 +316,27 @@ bool Guild::LoadRanksFromDB(uint32 GuildId)
rankRights |= GR_RIGHT_ALL; rankRights |= GR_RIGHT_ALL;
AddRank(rankName,rankRights,rankMoney); AddRank(rankName,rankRights,rankMoney);
}while (result->NextRow()); }while( guildRanksResult->NextRow() );
if (m_Ranks.size() < GUILD_RANKS_MIN_COUNT) // if too few ranks, renew them if (m_Ranks.size() < GUILD_RANKS_MIN_COUNT) // if too few ranks, renew them
{ {
m_Ranks.clear(); m_Ranks.clear();
sLog.outError("Guild %u has broken `guild_rank` data, creating new...",GuildId); sLog.outError("Guild %u has broken `guild_rank` data, creating new...", m_Id);
CreateDefaultGuildRanks(0); // 0 is default locale_idx CreateDefaultGuildRanks(0); // 0 is default locale_idx
broken_ranks = false; broken_ranks = false;
} }
// guild_rank have wrong numbered ranks, repair // guild_rank have wrong numbered ranks, repair
if (broken_ranks) if (broken_ranks)
{ {
sLog.outError("Guild %u has broken `guild_rank` data, repairing...",GuildId); sLog.outError("Guild %u has broken `guild_rank` data, repairing...", m_Id);
CharacterDatabase.BeginTransaction(); CharacterDatabase.BeginTransaction();
CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", GuildId); CharacterDatabase.PExecute("DELETE FROM guild_rank WHERE guildid='%u'", m_Id);
for (size_t i = 0; i < m_Ranks.size(); ++i) for (size_t i = 0; i < m_Ranks.size(); ++i)
{ {
std::string name = m_Ranks[i].Name; std::string name = m_Ranks[i].Name;
uint32 rights = m_Ranks[i].Rights; uint32 rights = m_Ranks[i].Rights;
CharacterDatabase.escape_string(name); CharacterDatabase.escape_string(name);
CharacterDatabase.PExecute( "INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", GuildId, uint32(i), name.c_str(), rights); CharacterDatabase.PExecute( "INSERT INTO guild_rank (guildid,rid,rname,rights) VALUES ('%u', '%u', '%s', '%u')", m_Id, uint32(i), name.c_str(), rights);
} }
CharacterDatabase.CommitTransaction(); CharacterDatabase.CommitTransaction();
} }
@@ -350,46 +344,53 @@ bool Guild::LoadRanksFromDB(uint32 GuildId)
return true; return true;
} }
bool Guild::LoadMembersFromDB(uint32 GuildId) bool Guild::LoadMembersFromDB(QueryResult_AutoPtr guildMembersResult)
{ {
// 0 1 2 3 4 5 if (!guildMembersResult)
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT guild_member.guid,rank, pnote, offnote, BankResetTimeMoney,BankRemMoney,"
// 6 7 8 9 10 11
"BankResetTimeTab0, BankRemSlotsTab0, BankResetTimeTab1, BankRemSlotsTab1, BankResetTimeTab2, BankRemSlotsTab2,"
// 12 13 14 15 16 17
"BankResetTimeTab3, BankRemSlotsTab3, BankResetTimeTab4, BankRemSlotsTab4, BankResetTimeTab5, BankRemSlotsTab5,"
// 18 19 20 21 22
"characters.name, characters.level, characters.zone, characters.class, characters.logout_time "
"FROM guild_member LEFT JOIN characters ON characters.guid = guild_member.guid WHERE guildid = '%u'", GuildId);
if (!result)
return false; return false;
do do
{ {
Field *fields = result->Fetch(); Field *fields = guildMembersResult->Fetch();
//this condition will be true when all rows in QueryResult are processed and new guild without members is going to be loaded - prevent crash
if (!fields)
break;
uint32 guildId = fields[0].GetUInt32();
if (guildId < m_Id)
{
//there is in table guild_member record which doesn't have guildid in guild table, report error
sLog.outErrorDb("Guild %u does not exist but it has a record in guild_member table, deleting it!", guildId);
CharacterDatabase.PExecute("DELETE FROM guild_member WHERE guildid = '%u'", guildId);
continue;
}
if (guildId > m_Id)
//we loaded all members for this guild already, break cycle
break;
MemberSlot newmember; MemberSlot newmember;
uint64 guid = MAKE_NEW_GUID(fields[0].GetUInt32(), 0, HIGHGUID_PLAYER); uint64 guid = MAKE_NEW_GUID(fields[1].GetUInt32(), 0, HIGHGUID_PLAYER);
newmember.RankId = fields[1].GetUInt32(); newmember.RankId = fields[2].GetUInt32();
//don't allow member to have not existing rank! //don't allow member to have not existing rank!
if (newmember.RankId >= m_Ranks.size()) if (newmember.RankId >= m_Ranks.size())
newmember.RankId = GetLowestRank(); newmember.RankId = GetLowestRank();
newmember.Pnote = fields[2].GetCppString(); newmember.Pnote = fields[3].GetCppString();
newmember.OFFnote = fields[3].GetCppString(); newmember.OFFnote = fields[4].GetCppString();
newmember.BankResetTimeMoney = fields[4].GetUInt32(); newmember.BankResetTimeMoney = fields[5].GetUInt32();
newmember.BankRemMoney = fields[5].GetUInt32(); newmember.BankRemMoney = fields[6].GetUInt32();
for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i) for (uint8 i = 0; i < GUILD_BANK_MAX_TABS; ++i)
{ {
newmember.BankResetTimeTab[i] = fields[6+(2*i)].GetUInt32(); newmember.BankResetTimeTab[i] = fields[7+(2*i)].GetUInt32();
newmember.BankRemSlotsTab[i] = fields[7+(2*i)].GetUInt32(); newmember.BankRemSlotsTab[i] = fields[8+(2*i)].GetUInt32();
} }
newmember.Name = fields[18].GetCppString(); newmember.Name = fields[19].GetCppString();
newmember.Level = fields[19].GetUInt8(); newmember.Level = fields[20].GetUInt8();
newmember.ZoneId = fields[20].GetUInt32();
newmember.Class = fields[21].GetUInt8(); newmember.Class = fields[21].GetUInt8();
newmember.LogoutTime = fields[22].GetUInt64(); newmember.ZoneId = fields[22].GetUInt32();
newmember.LogoutTime = fields[23].GetUInt64();
//this code will remove unexisting character guids from guild //this code will remove unexisting character guids from guild
if (newmember.Level < 1 || newmember.Level > STRONG_MAX_LEVEL) // can be at broken `data` field if (newmember.Level < 1 || newmember.Level > STRONG_MAX_LEVEL) // can be at broken `data` field
@@ -414,7 +415,7 @@ bool Guild::LoadMembersFromDB(uint32 GuildId)
members[GUID_LOPART(guid)] = newmember; members[GUID_LOPART(guid)] = newmember;
}while (result->NextRow()); }while (guildMembersResult->NextRow());
if (members.empty()) if (members.empty())
return false; return false;
@@ -1372,27 +1373,39 @@ uint32 Guild::GetBankSlotPerDay(uint32 rankId, uint8 TabId)
// ************************************************* // *************************************************
// Rights per day related // Rights per day related
void Guild::LoadBankRightsFromDB(uint32 GuildId) bool Guild::LoadBankRightsFromDB(QueryResult_AutoPtr guildBankTabRightsResult)
{ {
// 0 1 2 3 if (!guildBankTabRightsResult)
QueryResult_AutoPtr result = CharacterDatabase.PQuery("SELECT TabId, rid, gbright, SlotPerDay FROM guild_bank_right WHERE guildid = '%u' ORDER BY TabId", GuildId); return true;
if (!result)
return;
do do
{ {
Field *fields = result->Fetch(); Field *fields = guildBankTabRightsResult->Fetch();
uint8 TabId = fields[0].GetUInt8(); //prevent crash when all rights in result are already processed
uint32 rankId = fields[1].GetUInt32(); if (!fields)
uint16 right = fields[2].GetUInt16(); break;
uint16 SlotPerDay = fields[3].GetUInt16(); uint32 guildId = fields[0].GetUInt32();
if (guildId < m_Id)
{
//there is in table guild_bank_right record which doesn't have guildid in guild table, report error
sLog.outErrorDb("Guild %u does not exist but it has a record in guild_bank_right table, deleting it!", guildId);
CharacterDatabase.PExecute("DELETE FROM guild_bank_right WHERE guildid = '%u'", guildId);
continue;
}
if (guildId > m_Id)
//we loaded all ranks for this guild bank already, break cycle
break;
uint8 TabId = fields[1].GetUInt8();
uint32 rankId = fields[2].GetUInt32();
uint16 right = fields[3].GetUInt16();
uint16 SlotPerDay = fields[4].GetUInt16();
SetBankRightsAndSlots(rankId, TabId, right, SlotPerDay, false); SetBankRightsAndSlots(rankId, TabId, right, SlotPerDay, false);
}while (result->NextRow()); }while (guildBankTabRightsResult->NextRow());
return; return true;
} }
// ************************************************* // *************************************************
+5 -4
View File
@@ -327,9 +327,10 @@ class Guild
uint32 GetMemberSize() const { return members.size(); } uint32 GetMemberSize() const { return members.size(); }
bool LoadGuildFromDB(uint32 GuildId); bool LoadGuildFromDB(QueryResult_AutoPtr guildDataResult);
bool LoadRanksFromDB(uint32 GuildId); bool CheckGuildStructure();
bool LoadMembersFromDB(uint32 GuildId); bool LoadRanksFromDB(QueryResult_AutoPtr guildRanksResult);
bool LoadMembersFromDB(QueryResult_AutoPtr guildMembersResult);
void SetMemberStats(uint64 guid); void SetMemberStats(uint64 guid);
@@ -421,7 +422,7 @@ class Guild
uint32 GetBankMoneyPerDay(uint32 rankId); uint32 GetBankMoneyPerDay(uint32 rankId);
uint32 GetBankSlotPerDay(uint32 rankId, uint8 TabId); uint32 GetBankSlotPerDay(uint32 rankId, uint8 TabId);
// rights per day // rights per day
void LoadBankRightsFromDB(uint32 GuildId); bool LoadBankRightsFromDB(QueryResult_AutoPtr guildBankTabRightsResult);
// Guild Bank Event Logs // Guild Bank Event Logs
void LoadGuildBankEventLogFromDB(); void LoadGuildBankEventLogFromDB();
void DisplayGuildBankLogs(WorldSession *session, uint8 TabId); void DisplayGuildBankLogs(WorldSession *session, uint8 TabId);
+69 -17
View File
@@ -730,6 +730,13 @@ void ObjectMgr::LoadCreatureTemplates()
const_cast<CreatureInfo*>(cInfo)->InhabitType = INHABIT_ANYWHERE; const_cast<CreatureInfo*>(cInfo)->InhabitType = INHABIT_ANYWHERE;
} }
if (cInfo->VehicleId)
{
VehicleEntry const* vehId = sVehicleStore.LookupEntry(cInfo->VehicleId);
if (!vehId)
sLog.outErrorDb("Creature (Entry: %u) has a non-existing VehicleId (%u). This *WILL* cause the client to freeze!", cInfo->Entry, cInfo->VehicleId);
}
if(cInfo->PetSpellDataId) if(cInfo->PetSpellDataId)
{ {
CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId); CreatureSpellDataEntry const* spellDataId = sCreatureSpellDataStore.LookupEntry(cInfo->PetSpellDataId);
@@ -3216,10 +3223,14 @@ void ObjectMgr::BuildPlayerLevelInfo(uint8 race, uint8 _class, uint8 level, Play
void ObjectMgr::LoadGuilds() void ObjectMgr::LoadGuilds()
{ {
Guild *newguild; Guild *newGuild;
uint32 count = 0; uint32 count = 0;
QueryResult_AutoPtr result = CharacterDatabase.Query( "SELECT guildid FROM guild" ); // 0 1 2 3 4 5 6
QueryResult_AutoPtr result = CharacterDatabase.Query("SELECT guild.guildid,guild.name,leaderguid,EmblemStyle,EmblemColor,BorderStyle,BorderColor,"
// 7 8 9 10 11 12
"BackgroundColor,info,motd,createdate,BankMoney,COUNT(guild_bank_tab.guildid) "
"FROM guild LEFT JOIN guild_bank_tab ON guild.guildid = guild_bank_tab.guildid GROUP BY guild.guildid ORDER BY guildid ASC");
if (!result) if (!result)
{ {
@@ -3233,26 +3244,50 @@ void ObjectMgr::LoadGuilds()
return; return;
} }
// load guild ranks
// 0 1 2 3 4
QueryResult_AutoPtr guildRanksResult = CharacterDatabase.Query("SELECT guildid,rid,rname,rights,BankMoneyPerDay FROM guild_rank ORDER BY guildid ASC, rid ASC");
// load guild members
// 0 1 2 3 4 5 6
QueryResult_AutoPtr guildMembersResult = CharacterDatabase.Query("SELECT guildid,guild_member.guid,rank,pnote,offnote,BankResetTimeMoney,BankRemMoney,"
// 7 8 9 10 11 12
"BankResetTimeTab0,BankRemSlotsTab0,BankResetTimeTab1,BankRemSlotsTab1,BankResetTimeTab2,BankRemSlotsTab2,"
// 13 14 15 16 17 18
"BankResetTimeTab3,BankRemSlotsTab3,BankResetTimeTab4,BankRemSlotsTab4,BankResetTimeTab5,BankRemSlotsTab5,"
// 19 20 21 22 23
"characters.name, characters.level, characters.class, characters.zone, characters.logout_time "
"FROM guild_member LEFT JOIN characters ON characters.guid = guild_member.guid ORDER BY guildid ASC");
// load guild bank tab rights
// 0 1 2 3 4
QueryResult_AutoPtr guildBankTabRightsResult = CharacterDatabase.Query("SELECT guildid,TabId,rid,gbright,SlotPerDay FROM guild_bank_right ORDER BY guildid ASC, TabId ASC");
barGoLink bar(result->GetRowCount()); barGoLink bar(result->GetRowCount());
do do
{ {
Field *fields = result->Fetch(); //Field *fields = result->Fetch();
bar.step(); bar.step();
++count; ++count;
newguild = new Guild; newGuild = new Guild;
if (!newguild->LoadGuildFromDB(fields[0].GetUInt32())) if (!newGuild->LoadGuildFromDB(result) ||
{ !newGuild->LoadRanksFromDB(guildRanksResult) ||
newguild->Disband(); !newGuild->LoadMembersFromDB(guildMembersResult) ||
delete newguild; !newGuild->LoadBankRightsFromDB(guildBankTabRightsResult) ||
!newGuild->CheckGuildStructure()
)
{
newGuild->Disband();
delete newGuild;
continue; continue;
} }
newguild->LoadGuildEventLogFromDB(); newGuild->LoadGuildEventLogFromDB();
newguild->LoadGuildBankEventLogFromDB(); newGuild->LoadGuildBankEventLogFromDB();
newguild->LoadGuildBankFromDB(); newGuild->LoadGuildBankFromDB();
AddGuild(newguild); AddGuild(newGuild);
} while (result->NextRow()); } while (result->NextRow());
@@ -3269,7 +3304,11 @@ void ObjectMgr::LoadArenaTeams()
{ {
uint32 count = 0; uint32 count = 0;
QueryResult_AutoPtr result = CharacterDatabase.Query( "SELECT arenateamid FROM arena_team" ); // 0 1 2 3 4 5
QueryResult_AutoPtr result = CharacterDatabase.Query( "SELECT arena_team.arenateamid,name,captainguid,type,BackgroundColor,EmblemStyle,"
// 6 7 8 9 10 11 12 13 14
"EmblemColor,BorderStyle,BorderColor, rating,games,wins,played,wins2,rank "
"FROM arena_team LEFT JOIN arena_team_stats ON arena_team.arenateamid = arena_team_stats.arenateamid ORDER BY arena_team.arenateamid ASC" );
if( !result ) if( !result )
{ {
@@ -3283,6 +3322,12 @@ void ObjectMgr::LoadArenaTeams()
return; return;
} }
// load arena_team members
QueryResult_AutoPtr arenaTeamMembersResult = CharacterDatabase.Query(
// 0 1 2 3 4 5 6 7 8
"SELECT arenateamid,member.guid,played_week,wons_week,played_season,wons_season,personal_rating,name,class "
"FROM arena_team_member member LEFT JOIN characters chars on member.guid = chars.guid ORDER BY member.arenateamid ASC");
barGoLink bar( result->GetRowCount() ); barGoLink bar( result->GetRowCount() );
do do
@@ -3292,13 +3337,15 @@ void ObjectMgr::LoadArenaTeams()
bar.step(); bar.step();
++count; ++count;
ArenaTeam *newarenateam = new ArenaTeam; ArenaTeam *newArenaTeam = new ArenaTeam;
if(!newarenateam->LoadArenaTeamFromDB(fields[0].GetUInt32())) if (!newArenaTeam->LoadArenaTeamFromDB(result) ||
!newArenaTeam->LoadMembersFromDB(arenaTeamMembersResult))
{ {
delete newarenateam; newArenaTeam->Disband(NULL);
delete newArenaTeam;
continue; continue;
} }
AddArenaTeam(newarenateam); AddArenaTeam(newArenaTeam);
}while( result->NextRow() ); }while( result->NextRow() );
sLog.outString(); sLog.outString();
@@ -7612,6 +7659,11 @@ bool PlayerCondition::Meets(Player const * player) const
QuestStatus status = player->GetQuestStatus(value1); QuestStatus status = player->GetQuestStatus(value1);
return (status == QUEST_STATUS_INCOMPLETE); return (status == QUEST_STATUS_INCOMPLETE);
} }
case CONDITION_QUEST_NONE:
{
QuestStatus status = player->GetQuestStatus(value1);
return (status == QUEST_STATUS_NONE);
}
case CONDITION_AD_COMMISSION_AURA: case CONDITION_AD_COMMISSION_AURA:
{ {
Unit::AuraApplicationMap const& auras = player->GetAppliedAuras(); Unit::AuraApplicationMap const& auras = player->GetAppliedAuras();
+2 -1
View File
@@ -311,9 +311,10 @@ enum ConditionType
CONDITION_NO_AURA = 11, // spell_id effindex CONDITION_NO_AURA = 11, // spell_id effindex
CONDITION_ACTIVE_EVENT = 12, // event_id CONDITION_ACTIVE_EVENT = 12, // event_id
CONDITION_INSTANCE_DATA = 13, // entry data CONDITION_INSTANCE_DATA = 13, // entry data
CONDITION_QUEST_NONE = 14, // quest_id 0
}; };
#define MAX_CONDITION 14 // maximum value in ConditionType enum #define MAX_CONDITION 15 // maximum value in ConditionType enum
struct PlayerCondition struct PlayerCondition
{ {
+21 -8
View File
@@ -2023,6 +2023,12 @@ void Player::RegenerateAll()
Regenerate(POWER_MANA); Regenerate(POWER_MANA);
// Runes act as cooldowns, and they don't need to send any data
if(getClass() == CLASS_DEATH_KNIGHT)
for (uint32 i = 0; i < MAX_RUNES; ++i)
if(uint32 cd = GetRuneCooldown(i))
SetRuneCooldown(i, (cd > m_regenTimer) ? cd - m_regenTimer : 0);
if (m_regenTimerCount >= 2000) if (m_regenTimerCount >= 2000)
{ {
// Not in combat or they have regeneration // Not in combat or they have regeneration
@@ -2036,9 +2042,6 @@ void Player::RegenerateAll()
if (getClass() == CLASS_DEATH_KNIGHT) if (getClass() == CLASS_DEATH_KNIGHT)
Regenerate(POWER_RUNIC_POWER); Regenerate(POWER_RUNIC_POWER);
if(getClass() == CLASS_DEATH_KNIGHT)
Regenerate(POWER_RUNE);
m_regenTimerCount -= 2000; m_regenTimerCount -= 2000;
} }
@@ -2047,11 +2050,6 @@ void Player::RegenerateAll()
void Player::Regenerate(Powers power) void Player::Regenerate(Powers power)
{ {
if (power == POWER_RUNE)
for (uint32 i = 0; i < MAX_RUNES; ++i)
if (uint8 cd = GetRuneCooldown(i)) // if we have cooldown, reduce it...
SetRuneCooldown(i, cd - 1); // ... by 2 sec (because update is every 2 sec)
uint32 maxValue = GetMaxPower(power); uint32 maxValue = GetMaxPower(power);
if (!maxValue) if (!maxValue)
return; return;
@@ -21785,6 +21783,21 @@ void Player::UpdateCharmedAI()
} }
} }
uint32 Player::GetRuneBaseCooldown(uint8 index)
{
uint8 rune = GetBaseRune(index);
uint32 cooldown = RUNE_COOLDOWN;
AuraEffectList const& regenAura = GetAuraEffectsByType(SPELL_AURA_MOD_POWER_REGEN_PERCENT);
for(AuraEffectList::const_iterator i = regenAura.begin();i != regenAura.end(); ++i)
{
if((*i)->GetMiscValue() == POWER_RUNE && (*i)->GetMiscValueB() == rune)
cooldown = cooldown*(100-(*i)->GetAmount())/100;
}
return cooldown;
}
void Player::RemoveRunesByAuraEffect(AuraEffect const * aura) void Player::RemoveRunesByAuraEffect(AuraEffect const * aura)
{ {
for(uint8 i = 0; i < MAX_RUNES; ++i) for(uint8 i = 0; i < MAX_RUNES; ++i)
+5 -4
View File
@@ -281,7 +281,7 @@ struct Areas
}; };
#define MAX_RUNES 6 #define MAX_RUNES 6
#define RUNE_COOLDOWN 5 // 5*2=10 sec #define RUNE_COOLDOWN 10000
enum RuneType enum RuneType
{ {
@@ -296,7 +296,7 @@ struct RuneInfo
{ {
uint8 BaseRune; uint8 BaseRune;
uint8 CurrentRune; uint8 CurrentRune;
uint8 Cooldown; uint32 Cooldown;
AuraEffect const * ConvertAura; AuraEffect const * ConvertAura;
}; };
@@ -2259,13 +2259,14 @@ class Player : public Unit, public GridObject<Player>
uint8 GetRunesState() const { return m_runes->runeState; } uint8 GetRunesState() const { return m_runes->runeState; }
RuneType GetBaseRune(uint8 index) const { return RuneType(m_runes->runes[index].BaseRune); } RuneType GetBaseRune(uint8 index) const { return RuneType(m_runes->runes[index].BaseRune); }
RuneType GetCurrentRune(uint8 index) const { return RuneType(m_runes->runes[index].CurrentRune); } RuneType GetCurrentRune(uint8 index) const { return RuneType(m_runes->runes[index].CurrentRune); }
uint8 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; } uint32 GetRuneCooldown(uint8 index) const { return m_runes->runes[index].Cooldown; }
uint32 GetRuneBaseCooldown(uint8 index);
bool IsBaseRuneSlotsOnCooldown(RuneType runeType) const; bool IsBaseRuneSlotsOnCooldown(RuneType runeType) const;
RuneType GetLastUsedRune() { return m_runes->lastUsedRune; } RuneType GetLastUsedRune() { return m_runes->lastUsedRune; }
void SetLastUsedRune(RuneType type) { m_runes->lastUsedRune = type; } void SetLastUsedRune(RuneType type) { m_runes->lastUsedRune = type; }
void SetBaseRune(uint8 index, RuneType baseRune) { m_runes->runes[index].BaseRune = baseRune; } void SetBaseRune(uint8 index, RuneType baseRune) { m_runes->runes[index].BaseRune = baseRune; }
void SetCurrentRune(uint8 index, RuneType currentRune) { m_runes->runes[index].CurrentRune = currentRune; } void SetCurrentRune(uint8 index, RuneType currentRune) { m_runes->runes[index].CurrentRune = currentRune; }
void SetRuneCooldown(uint8 index, uint8 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); } void SetRuneCooldown(uint8 index, uint32 cooldown) { m_runes->runes[index].Cooldown = cooldown; m_runes->SetRuneState(index, (cooldown == 0) ? true : false); }
void SetRuneConvertAura(uint8 index, AuraEffect const * aura) { m_runes->runes[index].ConvertAura = aura; } void SetRuneConvertAura(uint8 index, AuraEffect const * aura) { m_runes->runes[index].ConvertAura = aura; }
void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const * aura) { SetRuneConvertAura(index, aura); ConvertRune(index, newType); } void AddRuneByAuraEffect(uint8 index, RuneType newType, AuraEffect const * aura) { SetRuneConvertAura(index, aura); ConvertRune(index, newType); }
void RemoveRunesByAuraEffect(AuraEffect const * aura); void RemoveRunesByAuraEffect(AuraEffect const * aura);
+2
View File
@@ -238,6 +238,7 @@ void AddSC_boss_ptheradras();
void AddSC_boss_onyxia(); //Onyxia's Lair void AddSC_boss_onyxia(); //Onyxia's Lair
void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs void AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
void AddSC_razorfen_downs(); void AddSC_razorfen_downs();
void AddSC_instance_razorfen_downs();
void AddSC_razorfen_kraul(); //Razorfen Kraul void AddSC_razorfen_kraul(); //Razorfen Kraul
void AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj void AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
void AddSC_boss_rajaxx(); void AddSC_boss_rajaxx();
@@ -702,6 +703,7 @@ void AddScripts()
AddSC_boss_onyxia(); //Onyxia's Lair AddSC_boss_onyxia(); //Onyxia's Lair
AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs AddSC_boss_amnennar_the_coldbringer(); //Razorfen Downs
AddSC_razorfen_downs(); AddSC_razorfen_downs();
AddSC_instance_razorfen_downs();
AddSC_razorfen_kraul(); //Razorfen Kraul AddSC_razorfen_kraul(); //Razorfen Kraul
AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj AddSC_boss_kurinnaxx(); //Ruins of ahn'qiraj
AddSC_boss_rajaxx(); AddSC_boss_rajaxx();
+4 -4
View File
@@ -2995,8 +2995,8 @@ void Spell::cast(bool skipCheck)
m_caster->RemoveAurasDueToSpell(-(*i)); m_caster->RemoveAurasDueToSpell(-(*i));
else else
m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, *i, true); m_caster->CastSpell(m_targets.getUnitTarget() ? m_targets.getUnitTarget() : m_caster, *i, true);
}
}
if (m_caster->GetTypeId() == TYPEID_PLAYER) if (m_caster->GetTypeId() == TYPEID_PLAYER)
((Player*)m_caster)->SetSpellModTakingSpell(this, false); ((Player*)m_caster)->SetSpellModTakingSpell(this, false);
@@ -4076,7 +4076,7 @@ void Spell::TakePower()
Powers powerType = Powers(m_spellInfo->powerType); Powers powerType = Powers(m_spellInfo->powerType);
if(powerType == POWER_RUNE) if(hit && powerType == POWER_RUNE)
{ {
TakeRunePower(); TakeRunePower();
return; return;
@@ -4219,7 +4219,7 @@ void Spell::TakeRunePower()
RuneType rune = plr->GetCurrentRune(i); RuneType rune = plr->GetCurrentRune(i);
if((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0)) if((plr->GetRuneCooldown(i) == 0) && (runeCost[rune] > 0))
{ {
plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec plr->SetRuneCooldown(i, plr->GetRuneBaseCooldown(i));
plr->SetLastUsedRune(RuneType(rune)); plr->SetLastUsedRune(RuneType(rune));
runeCost[rune]--; runeCost[rune]--;
} }
@@ -4234,7 +4234,7 @@ void Spell::TakeRunePower()
RuneType rune = plr->GetCurrentRune(i); RuneType rune = plr->GetCurrentRune(i);
if((plr->GetRuneCooldown(i) == 0) && (rune == RUNE_DEATH)) if((plr->GetRuneCooldown(i) == 0) && (rune == RUNE_DEATH))
{ {
plr->SetRuneCooldown(i, RUNE_COOLDOWN); // 5*2=10 sec plr->SetRuneCooldown(i, plr->GetRuneBaseCooldown(i));
plr->SetLastUsedRune(RuneType(rune)); plr->SetLastUsedRune(RuneType(rune));
runeCost[rune]--; runeCost[rune]--;
+2 -2
View File
@@ -1381,7 +1381,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
{ {
// Not listed as any effect, only base points set // Not listed as any effect, only base points set
int32 basePoints0 = unholyPresenceAura->GetSpellProto()->EffectBasePoints[1]; int32 basePoints0 = unholyPresenceAura->GetSpellProto()->EffectBasePoints[1];
//target->CastCustomSpell(target,63622,&basePoints0 ,NULL,NULL,true,0,unholyPresenceAura); target->CastCustomSpell(target,63622,&basePoints0 ,&basePoints0,&basePoints0,true,0,unholyPresenceAura);
target->CastCustomSpell(target,65095,&basePoints0 ,NULL,NULL,true,0,unholyPresenceAura); target->CastCustomSpell(target,65095,&basePoints0 ,NULL,NULL,true,0,unholyPresenceAura);
} }
target->CastSpell(target,49772, true); target->CastSpell(target,49772, true);
@@ -1403,7 +1403,7 @@ void Aura::HandleAuraSpecificMods(AuraApplication const * aurApp, Unit * caster,
{ {
if(presence == 48265 && unholyPresenceAura) if(presence == 48265 && unholyPresenceAura)
{ {
//target->RemoveAurasDueToSpell(63622); target->RemoveAurasDueToSpell(63622);
target->RemoveAurasDueToSpell(65095); target->RemoveAurasDueToSpell(65095);
} }
target->RemoveAurasDueToSpell(49772); target->RemoveAurasDueToSpell(49772);
+9 -1
View File
@@ -6836,7 +6836,15 @@ void Spell::EffectPlayerPull(uint32 i)
if(!unitTarget) if(!unitTarget)
return; return;
unitTarget->GetMotionMaster()->MoveJump(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), float(damage ? damage : unitTarget->GetDistance2d(m_caster)), float(m_spellInfo->EffectMiscValue[i])/10); float speedZ;
if(m_spellInfo->EffectMiscValue[i])
speedZ = float(m_spellInfo->EffectMiscValue[i])/10;
else if(m_spellInfo->EffectMiscValueB[i])
speedZ = float(m_spellInfo->EffectMiscValueB[i])/10;
else
speedZ = 10.0f;
float speedXY = m_caster->GetExactDist2d(unitTarget) * 10.0f / speedZ;
unitTarget->GetMotionMaster()->MoveJump(m_caster->GetPositionX(), m_caster->GetPositionY(), m_caster->GetPositionZ(), speedXY, speedZ);
} }
void Spell::EffectDispelMechanic(uint32 i) void Spell::EffectDispelMechanic(uint32 i)
+14 -1
View File
@@ -7287,6 +7287,19 @@ bool Unit::HandleDummyAuraProc(Unit *pVictim, uint32 damage, AuraEffect* trigger
if (dummySpell->Id == 49194) if (dummySpell->Id == 49194)
{ {
basepoints0 = triggerAmount * damage / 100; basepoints0 = triggerAmount * damage / 100;
// Glyph of Unholy Blight
if (AuraEffect *glyph=GetAuraEffect(63332,0))
basepoints0 += basepoints0 * glyph->GetAmount() / 100;
// Find replaced aura to use it's remaining amount
AuraEffectList const& DoTAuras = target->GetAuraEffectsByType(SPELL_AURA_PERIODIC_DAMAGE);
for (Unit::AuraEffectList::const_iterator i = DoTAuras.begin(); i != DoTAuras.end(); ++i)
{
if ((*i)->GetCasterGUID() != GetGUID() || (*i)->GetId() != 50536)
continue;
basepoints0 += ((*i)->GetAmount() * ((*i)->GetTotalTicks() - ((*i)->GetTickNumber()))) / (*i)->GetTotalTicks();
break;
}
triggered_spell_id = 50536; triggered_spell_id = 50536;
break; break;
} }
@@ -7709,7 +7722,7 @@ bool Unit::HandleAuraProc(Unit *pVictim, uint32 damage, Aura * triggeredByAura,
((Player*)this)->GetBaseRune(i) != RUNE_BLOOD ) ((Player*)this)->GetBaseRune(i) != RUNE_BLOOD )
continue; continue;
} }
if (((Player*)this)->GetRuneCooldown(i) != RUNE_COOLDOWN) if (((Player*)this)->GetRuneCooldown(i) != ((Player*)this)->GetRuneBaseCooldown(i))
continue; continue;
--runesLeft; --runesLeft;
+3
View File
@@ -253,6 +253,8 @@ SET(scripts_STAT_SRCS
kalimdor/onyxias_lair/boss_onyxia.cpp kalimdor/onyxias_lair/boss_onyxia.cpp
kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp kalimdor/razorfen_downs/boss_amnennar_the_coldbringer.cpp
kalimdor/razorfen_downs/razorfen_downs.cpp kalimdor/razorfen_downs/razorfen_downs.cpp
kalimdor/razorfen_downs/instance_razorfen_downs.cpp
kalimdor/razorfen_downs/razorfen_downs.h
kalimdor/razorfen_kraul/razorfen_kraul.h kalimdor/razorfen_kraul/razorfen_kraul.h
kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp kalimdor/razorfen_kraul/instance_razorfen_kraul.cpp
kalimdor/razorfen_kraul/razorfen_kraul.cpp kalimdor/razorfen_kraul/razorfen_kraul.cpp
@@ -327,6 +329,7 @@ SET(scripts_STAT_SRCS
northrend/draktharon_keep/boss_tharon_ja.cpp northrend/draktharon_keep/boss_tharon_ja.cpp
northrend/draktharon_keep/drak_tharon_keep.h northrend/draktharon_keep/drak_tharon_keep.h
northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp northrend/frozen_halls/forge_of_souls/instance_forge_of_souls.cpp
northrend/frozen_halls/forge_of_souls/boss_bronjahm.cpp
northrend/frozen_halls/forge_of_souls/forge_of_souls.h northrend/frozen_halls/forge_of_souls/forge_of_souls.h
northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp northrend/frozen_halls/halls_of_reflection/instance_halls_of_reflection.cpp
northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h northrend/frozen_halls/halls_of_reflection/halls_of_reflection.h
@@ -0,0 +1,215 @@
/*
* Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ScriptedPch.h"
#include "razorfen_downs.h"
#define MAX_ENCOUNTER 1
struct instance_razorfen_downs : public ScriptedInstance
{
instance_razorfen_downs(Map* pMap) : ScriptedInstance(pMap)
{
Initialize();
};
uint64 uiGongGUID;
uint32 m_auiEncounter[MAX_ENCOUNTER];
uint8 uiGongWaves;
std::string str_data;
void Initialize()
{
uiGongGUID = 0;
uiGongWaves = 0;
memset(&m_auiEncounter, 0, sizeof(m_auiEncounter));
}
std::string GetSaveData()
{
OUT_SAVE_INST_DATA;
std::ostringstream saveStream;
saveStream << "T C " << m_auiEncounter[0]
<< " " << uiGongWaves;
str_data = saveStream.str();
OUT_SAVE_INST_DATA_COMPLETE;
return str_data;
}
void Load(const char* in)
{
if (!in)
{
OUT_LOAD_INST_DATA_FAIL;
return;
}
OUT_LOAD_INST_DATA(in);
char dataHead1, dataHead2;
uint16 data0, data1;
std::istringstream loadStream(in);
loadStream >> dataHead1 >> dataHead2 >> data0 >> data1;
if (dataHead1 == 'T' && dataHead2 == 'C')
{
m_auiEncounter[0] = data0;
for (uint8 i = 0; i < MAX_ENCOUNTER; ++i)
if (m_auiEncounter[i] == IN_PROGRESS)
m_auiEncounter[i] = NOT_STARTED;
uiGongWaves = data1;
} else OUT_LOAD_INST_DATA_FAIL;
OUT_LOAD_INST_DATA_COMPLETE;
}
void OnGameObjectCreate(GameObject* pGo, bool bAdd)
{
switch(pGo->GetEntry())
{
case GO_GONG:
uiGongGUID = pGo->GetGUID();
if (m_auiEncounter[0] == DONE)
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
break;
default:
break;
}
}
void SetData(uint32 uiType, uint32 uiData)
{
if (uiType == DATA_GONG_WAVES)
{
uiGongWaves = uiData;
switch(uiGongWaves)
{
case 9:
case 14:
if (GameObject* pGo = instance->GetGameObject(uiGongGUID))
pGo->RemoveFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
break;
case 1:
case 10:
case 16:
{
GameObject* pGo = instance->GetGameObject(uiGongGUID);
if (!pGo)
return;
pGo->SetFlag(GAMEOBJECT_FLAGS,GO_FLAG_UNK1);
uint32 uiCreature = 0;
uint8 uiSummonTimes = 0;
switch(uiGongWaves)
{
case 1:
uiCreature = CREATURE_TOMB_FIEND;
uiSummonTimes = 7;
break;
case 10:
uiCreature = CREATURE_TOMB_REAVER;
uiSummonTimes = 3;
break;
case 16:
uiCreature = CREATURE_TUTEN_KASH;
break;
default:
break;
}
if (Creature* pCreature = pGo->SummonCreature(uiCreature,2502.635,844.140,46.896,0.633))
{
if (uiGongWaves == 10 || uiGongWaves == 1)
{
for (uint8 i = 0; i < uiSummonTimes; ++i)
{
if (Creature* pSummon = pGo->SummonCreature(uiCreature,2502.635 + float(irand(-5,5)),844.140 + float(irand(-5,5)),46.896,0.633))
pSummon->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678);
}
}
pCreature->GetMotionMaster()->MovePoint(0,2533.479 + float(irand(-5,5)),870.020 + float(irand(-5,5)),47.678);
}
break;
}
default:
break;
}
}
if (uiType == BOSS_TUTEN_KASH)
{
m_auiEncounter[0] = uiData;
if (uiData == DONE)
SaveToDB();
}
}
uint32 GetData(uint32 uiType)
{
switch(uiType)
{
case DATA_GONG_WAVES:
return uiGongWaves;
}
return 0;
}
uint64 GetData64(uint32 uiType)
{
switch(uiType)
{
case DATA_GONG: return uiGongGUID;
}
return 0;
}
};
InstanceData* GetInstanceData_instance_razorfen_downs(Map* pMap)
{
return new instance_razorfen_downs(pMap);
}
void AddSC_instance_razorfen_downs()
{
Script* newscript;
newscript = new Script;
newscript->Name = "instance_razorfen_downs";
newscript->GetInstanceData = &GetInstanceData_instance_razorfen_downs;
newscript->RegisterSelf();
}
@@ -26,6 +26,7 @@ npc_henry_stern
EndContentData */ EndContentData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "razorfen_downs.h"
/*### /*###
# npc_henry_stern # npc_henry_stern
@@ -73,6 +74,75 @@ bool GossipSelect_npc_henry_stern (Player* pPlayer, Creature* pCreature, uint32
return true; return true;
} }
/*######
## go_gong
######*/
bool GOHello_go_gong(Player* pPlayer, GameObject* pGO)
{
//basic support, not blizzlike data is missing...
ScriptedInstance* pInstance = pGO->GetInstanceData();
if (pInstance)
{
pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1);
return true;
}
return false;
}
enum eTombCreature
{
SPELL_WEB = 745
};
struct npc_tomb_creatureAI : public ScriptedAI
{
npc_tomb_creatureAI(Creature* pCreature) : ScriptedAI(pCreature)
{
pInstance = pCreature->GetInstanceData();
}
ScriptedInstance* pInstance;
uint32 uiWebTimer;
void Reset()
{
uiWebTimer = urand(5000,8000);
}
void UpdateAI(const uint32 uiDiff)
{
if (!UpdateVictim())
return;
//from acid
if (m_creature->GetEntry() == CREATURE_TOMB_REAVER)
{
if (uiWebTimer <= uiDiff)
{
DoCast(m_creature->getVictim(), SPELL_WEB);
uiWebTimer = urand(7000,16000);
} else uiWebTimer -= uiDiff;
}
DoMeleeAttackIfReady();
}
void JustDied(Unit* pKiller)
{
if (pInstance)
pInstance->SetData(DATA_GONG_WAVES,pInstance->GetData(DATA_GONG_WAVES)+1);
}
};
CreatureAI* GetAI_npc_tomb_creature(Creature* pCreature)
{
return new npc_tomb_creatureAI (pCreature);
}
void AddSC_razorfen_downs() void AddSC_razorfen_downs()
{ {
Script* newscript; Script* newscript;
@@ -82,4 +152,14 @@ void AddSC_razorfen_downs()
newscript->pGossipHello = &GossipHello_npc_henry_stern; newscript->pGossipHello = &GossipHello_npc_henry_stern;
newscript->pGossipSelect = &GossipSelect_npc_henry_stern; newscript->pGossipSelect = &GossipSelect_npc_henry_stern;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_gong";
newscript->pGOHello = &GOHello_go_gong;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_tomb_creature";
newscript->GetAI = &GetAI_npc_tomb_creature;
newscript->RegisterSelf();
} }
@@ -0,0 +1,45 @@
/*
* Copyright (C) 2010 Trinity <http://www.trinitycore.org/>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEF_RAZORFEN_DOWNS_H
#define DEF_RAZORFEN_DOWNS_H
enum eData
{
BOSS_TUTEN_KASH,
DATA_GONG_WAVES
};
enum eData64
{
DATA_GONG
};
enum eGameObject
{
GO_GONG = 148917
};
enum eCreature
{
CREATURE_TOMB_FIEND = 7349,
CREATURE_TOMB_REAVER = 7351,
CREATURE_TUTEN_KASH = 7355
};
#endif
+134
View File
@@ -1987,6 +1987,135 @@ CreatureAI* GetAI_npc_bonker_togglevolt(Creature* pCreature)
return new npc_bonker_togglevoltAI(pCreature); return new npc_bonker_togglevoltAI(pCreature);
} }
/*######
## Help Those That Cannot Help Themselves, Quest 11876
######*/
enum eHelpThemselves
{
QUEST_CANNOT_HELP_THEMSELVES = 11876,
GO_MAMMOTH_TRAP_1 = 188022,
GO_MAMMOTH_TRAP_2 = 188024,
GO_MAMMOTH_TRAP_3 = 188025,
GO_MAMMOTH_TRAP_4 = 188026,
GO_MAMMOTH_TRAP_5 = 188027,
GO_MAMMOTH_TRAP_6 = 188028,
GO_MAMMOTH_TRAP_7 = 188029,
GO_MAMMOTH_TRAP_8 = 188030,
GO_MAMMOTH_TRAP_9 = 188031,
GO_MAMMOTH_TRAP_10 = 188032,
GO_MAMMOTH_TRAP_11 = 188033,
GO_MAMMOTH_TRAP_12 = 188034,
GO_MAMMOTH_TRAP_13 = 188035,
GO_MAMMOTH_TRAP_14 = 188036,
GO_MAMMOTH_TRAP_15 = 188037,
GO_MAMMOTH_TRAP_16 = 188038,
GO_MAMMOTH_TRAP_17 = 188039,
GO_MAMMOTH_TRAP_18 = 188040,
GO_MAMMOTH_TRAP_19 = 188041,
GO_MAMMOTH_TRAP_20 = 188042,
GO_MAMMOTH_TRAP_21 = 188043,
GO_MAMMOTH_TRAP_22 = 188044,
};
struct npc_trapped_mammoth_calfAI : public ScriptedAI
{
npc_trapped_mammoth_calfAI(Creature* c) : ScriptedAI(c) {}
uint32 uiTimer;
bool bStarted;
void Reset()
{
GameObject *pTrap;
uiTimer = 1500;
bStarted = false;
if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,1.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,1.0f)))
pTrap->SetGoState(GO_STATE_ACTIVE);
}
void UpdateAI(const uint32 diff)
{
if (bStarted)
{
if (uiTimer <= diff)
{
Position pos;
m_creature->GetRandomNearPosition(pos, 10.0f);
m_creature->GetMotionMaster()->MovePoint(0,pos);
bStarted = false;
}
else uiTimer -= diff;
}
}
void DoAction(const int32 param)
{
if (param == 1)
bStarted = true;
}
void MovementInform(uint32 uiType, uint32 uiId)
{
GameObject* pTrap;
if (uiType != POINT_MOTION_TYPE)
return;
m_creature->DisappearAndDie();
if ((pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_1,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_2,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_3,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_4,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_5,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_6,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_7,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_8,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_9,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_10,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_11,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_12,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_13,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_14,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_15,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_16,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_17,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_18,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_19,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_20,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_21,11.0f)) ||
(pTrap = m_creature->FindNearestGameObject(GO_MAMMOTH_TRAP_22,11.0f)))
pTrap->SetLootState(GO_JUST_DEACTIVATED);
}
};
CreatureAI* GetAI_npc_trapped_mammoth_calf(Creature* pCreature)
{
return new npc_trapped_mammoth_calfAI(pCreature);
}
void AddSC_borean_tundra() void AddSC_borean_tundra()
{ {
Script *newscript; Script *newscript;
@@ -2122,4 +2251,9 @@ void AddSC_borean_tundra()
newscript->GetAI = &GetAI_npc_bonker_togglevolt; newscript->GetAI = &GetAI_npc_bonker_togglevolt;
newscript->pQuestAccept=&QuestAccept_npc_bonker_togglevolt; newscript->pQuestAccept=&QuestAccept_npc_bonker_togglevolt;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_trapped_mammoth_calf";
newscript->GetAI = &GetAI_npc_trapped_mammoth_calf;
newscript->RegisterSelf();
} }
@@ -261,6 +261,12 @@ struct generic_vehicleAI_toc5AI : public npc_escortAI
//dosen't work at all //dosen't work at all
if (uiShieldBreakerTimer <= uiDiff) if (uiShieldBreakerTimer <= uiDiff)
{ {
if (!pVehicle)
{
pVehicle = m_creature->GetVehicleKit();
return;
}
if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0)) if (Unit* pPassenger = pVehicle->GetPassenger(SEAT_ID_0))
{ {
Map::PlayerList const& players = m_creature->GetMap()->GetPlayers(); Map::PlayerList const& players = m_creature->GetMap()->GetPlayers();
@@ -0,0 +1,186 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ScriptedPch.h"
#include "forge_of_souls.h"
enum Spells
{
SPELL_MAGIC_S_BANE = 68793,
SPELL_MAGIC_S_BANE_H = 69050,
SPELL_CORRUPT_SOUL = 68839,
SPELL_CONSUME_SOUL = 68858,
SPELL_CONSUME_SOUL_H = 69047,
SPELL_TELEPORT = 68988,
SPELL_FEAR = 68950,
SPELL_SOULSTORM = 68872,
SPELL_SOULSTORM_H = 69049,
SPELL_SHADOW_BOLT = 70043
};
enum CombatPhases
{
PHASE_1,
PHASE_2
};
/*enum Adds
{
CREATURE_CORRUPTED_SOUL_FRAGMENT = 36535
};*/
struct boss_bronjahmAI : public ScriptedAI
{
boss_bronjahmAI(Creature *c) : ScriptedAI(c)
{
pInstance = m_creature->GetInstanceData();
}
uint32 uiFearTimer;
uint32 uiShadowBoltTimer;
uint32 uiMagicsBaneTimer;
uint32 uiCorruptSoulTimer;
CombatPhases Phase;
ScriptedInstance* pInstance;
void Reset()
{
Phase = PHASE_1;
uiFearTimer = urand(8000,12000);
uiShadowBoltTimer = 2000;
uiMagicsBaneTimer = urand(8000,15000);
uiCorruptSoulTimer = urand(15000,25000);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, NOT_STARTED);
}
void EnterCombat(Unit* who)
{
//DoScriptText(SAY_AGGRO, m_creature);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, IN_PROGRESS);
}
void JustDied(Unit* killer)
{
//DoScriptText(SAY_DEATH, m_creature);
if (pInstance)
pInstance->SetData(DATA_BRONJAHM_EVENT, DONE);
}
void UpdateAI(const uint32 diff)
{
//Return since we have no target
if (!UpdateVictim())
return;
switch (Phase)
{
case PHASE_1:
if (uiCorruptSoulTimer <= diff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(pTarget,SPELL_CORRUPT_SOUL);
uiCorruptSoulTimer = urand(15000,25000);
} else uiCorruptSoulTimer -= diff;
break;
case PHASE_2:
if (!me->HasAura(SPELL_SOULSTORM) || !me->HasAura(SPELL_SOULSTORM_H))
DoCast(m_creature, DUNGEON_MODE(SPELL_SOULSTORM,SPELL_SOULSTORM_H));
if (uiFearTimer <= diff)
{
if (Unit* pTarget = SelectUnit(SELECT_TARGET_RANDOM,1))
DoCast(m_creature->getVictim(),SPELL_FEAR);
uiFearTimer = urand(8000,12000);
} else uiFearTimer -= diff;
break;
}
if (HealthBelowPct(30))
DoCast(m_creature,SPELL_TELEPORT);
if (uiShadowBoltTimer <= diff)
{
if (m_creature->IsWithinMeleeRange(m_creature->getVictim()))
DoCastVictim(SPELL_SHADOW_BOLT);
uiShadowBoltTimer = 2000;
} else uiShadowBoltTimer -= diff;
if (uiMagicsBaneTimer <= diff)
{
DoCastVictim(DUNGEON_MODE(SPELL_MAGIC_S_BANE,SPELL_MAGIC_S_BANE_H));
uiMagicsBaneTimer = urand(8000,15000);
} else uiMagicsBaneTimer -= diff;
DoMeleeAttackIfReady();
}
};
CreatureAI* GetAI_boss_bronjahm(Creature* pCreature)
{
return new boss_bronjahmAI(pCreature);
}
struct mob_corrupted_soul_fragmentAI : public ScriptedAI
{
mob_corrupted_soul_fragmentAI(Creature *c) : ScriptedAI(c)
{
pInstance = m_creature->GetInstanceData();
}
ScriptedInstance* pInstance;
void Reset()
{
SetCombatMovement(false);
if (pInstance)
if (Creature* pBronjham = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_BRONJAHM)))
m_creature->GetMotionMaster()->MoveChase(pBronjham);
}
void MovementInform(uint32 type, uint32 id)
{
if (pInstance)
if (Creature* pBronjham = Unit::GetCreature(*m_creature,pInstance->GetData64(DATA_BRONJAHM)))
DoCast(pBronjham,DUNGEON_MODE(SPELL_CONSUME_SOUL,SPELL_CONSUME_SOUL_H));
}
void UpdateAI(const uint32 diff) {}
};
CreatureAI* GetAI_mob_corrupted_soul_fragment(Creature* pCreature)
{
return new mob_corrupted_soul_fragmentAI(pCreature);
}
void AddSC_boss_bronjahm()
{
Script *newscript;
newscript = new Script;
newscript->Name = "mob_corruptel_soul_fragment";
newscript->GetAI = &GetAI_mob_corrupted_soul_fragment;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "boss_bronjahm";
newscript->GetAI = &GetAI_boss_bronjahm;
newscript->RegisterSelf();
}
@@ -1,3 +1,19 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEF_FORGE_OF_SOULS_H #ifndef DEF_FORGE_OF_SOULS_H
#define DEF_FORGE_OF_SOULS_H #define DEF_FORGE_OF_SOULS_H
enum Data enum Data
@@ -5,6 +21,10 @@ enum Data
DATA_BRONJAHM_EVENT, DATA_BRONJAHM_EVENT,
DATA_DEVOURER_EVENT DATA_DEVOURER_EVENT
}; };
enum Data64
{
DATA_BRONJAHM
};
enum Creatures enum Creatures
{ {
CREATURE_BRONJAHM = 36497, CREATURE_BRONJAHM = 36497,
@@ -1,3 +1,19 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "forge_of_souls.h" #include "forge_of_souls.h"
@@ -72,16 +88,17 @@ struct instance_forge_of_souls : public ScriptedInstance
return 0; return 0;
} }
/*
uint64 GetData64(uint32 identifier) uint64 GetData64(uint32 identifier)
{ {
switch(identifier) switch(identifier)
{ {
case DATA_BRONJAHM: return uiBronjahm;
} }
return 0; return 0;
} }
*/
std::string GetSaveData() std::string GetSaveData()
{ {
OUT_SAVE_INST_DATA; OUT_SAVE_INST_DATA;
@@ -1,3 +1,19 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEF_HALLS_OF_REFLECTION_H #ifndef DEF_HALLS_OF_REFLECTION_H
#define DEF_HALLS_OF_REFLECTION_H #define DEF_HALLS_OF_REFLECTION_H
enum Data enum Data
@@ -1,3 +1,19 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "halls_of_reflection.h" #include "halls_of_reflection.h"
@@ -1,3 +1,19 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "pit_of_saron.h" #include "pit_of_saron.h"
@@ -1,3 +1,19 @@
/* Copyright (C) 2006 - 2010 TrinityCore <https://www.trinitycore.org/>
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#ifndef DEF_PIT_OF_SARON_H #ifndef DEF_PIT_OF_SARON_H
#define DEF_PIT_OF_SARON_H #define DEF_PIT_OF_SARON_H
enum Data enum Data
+252
View File
@@ -26,6 +26,7 @@ npc_orsonn_and_kodian
EndContentData */ EndContentData */
#include "ScriptedPch.h" #include "ScriptedPch.h"
#include "ScriptedEscortAI.h"
#define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg." #define GOSSIP_ITEM1 "You're free to go Orsonn, but first tell me what's wrong with the furbolg."
#define GOSSIP_ITEM2 "What happened then?" #define GOSSIP_ITEM2 "What happened then?"
@@ -115,6 +116,246 @@ bool GossipSelect_npc_orsonn_and_kodian(Player* pPlayer, Creature* pCreature, ui
return true; return true;
} }
/*######
## Quest 12027: Mr. Floppy's Perilous Adventure
######*/
enum eFloppy
{
NPC_MRFLOPPY = 26589,
NPC_HUNGRY_WORG = 26586,
NPC_RAVENOUS_WORG = 26590, //RWORG
NPC_EMILY = 26588,
QUEST_PERILOUS_ADVENTURE = 12027,
SPELL_MRFLOPPY = 47184, //vehicle aura
SAY_WORGHAGGRO1 = -1800001, //Um... I think one of those wolves is back...
SAY_WORGHAGGRO2 = -1800002, //He's going for Mr. Floppy!
SAY_WORGRAGGRO3 = -1800003, //Oh, no! Look, it's another wolf, and it's a biiiiiig one!
SAY_WORGRAGGRO4 = -1800004, //He's gonna eat Mr. Floppy! You gotta help Mr. Floppy! You just gotta!
SAY_RANDOMAGGRO = -1800005, //There's a big meanie attacking Mr. Floppy! Help!
SAY_VICTORY1 = -1800006, //Let's get out of here before more wolves find us!
SAY_VICTORY2 = -1800007, //Don't go toward the light, Mr. Floppy!
SAY_VICTORY3 = -1800008, //Mr. Floppy, you're ok! Thank you so much for saving Mr. Floppy!
SAY_VICTORY4 = -1800009, //I think I see the camp! We're almost home, Mr. Floppy! Let's go!
TEXT_EMOTE_WP1 = -1800010, //Mr. Floppy revives
TEXT_EMOTE_AGGRO = -1800011, //The Ravenous Worg chomps down on Mr. Floppy
SAY_QUEST_ACCEPT = -1800012, //Are you ready, Mr. Floppy? Stay close to me and watch out for those wolves!
SAY_QUEST_COMPLETE = -1800013 //Thank you for helping me get back to the camp. Go tell Walter that I'm safe now!
};
//emily
struct npc_emilyAI : public npc_escortAI
{
npc_emilyAI(Creature* pCreature) : npc_escortAI(pCreature) { }
uint32 m_uiChatTimer;
uint64 RWORGGUID;
uint64 MrfloppyGUID;
Creature* Mrfloppy;
Creature* RWORG;
bool Completed;
void JustSummoned(Creature* pSummoned)
{
if (Creature* Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 50.0f))
pSummoned->AI()->AttackStart(Mrfloppy);
else
pSummoned->AI()->AttackStart(m_creature->getVictim());
}
void WaypointReached(uint32 i)
{
Player* pPlayer = GetPlayerForEscort();
if (!pPlayer)
return;
switch (i)
{
case 9:
Mrfloppy = GetClosestCreatureWithEntry(m_creature, NPC_MRFLOPPY, 100.0f);
break;
case 10:
if (Mrfloppy)
{
DoScriptText(SAY_WORGHAGGRO1, m_creature);
m_creature->SummonCreature(NPC_HUNGRY_WORG,m_creature->GetPositionX()+5,m_creature->GetPositionY()+2,m_creature->GetPositionZ()+1,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
}
break;
case 11:
Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
break;
case 17:
Mrfloppy->GetMotionMaster()->MovePoint(0, m_creature->GetPositionX(), m_creature->GetPositionY(), m_creature->GetPositionZ());
DoScriptText(SAY_WORGRAGGRO3, m_creature);
RWORG = m_creature->SummonCreature(NPC_RAVENOUS_WORG,m_creature->GetPositionX()+10,m_creature->GetPositionY()+8,m_creature->GetPositionZ()+2,3.229f,TEMPSUMMON_TIMED_OR_DEAD_DESPAWN,120000);
RWORG->setFaction(35);
break;
case 18:
if (Mrfloppy)
{
RWORG->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
DoCast(Mrfloppy,SPELL_MRFLOPPY);
}
break;
case 19:
if (Mrfloppy->HasAura(SPELL_MRFLOPPY, 0))
Mrfloppy->EnterVehicle(RWORG);
break;
case 20:
if (Mrfloppy)
RWORG->HandleEmoteCommand(34);
break;
case 21:
if (Mrfloppy)
{
RWORG->Kill(Mrfloppy);
Mrfloppy->ExitVehicle();
RWORG->setFaction(14);
RWORG->GetMotionMaster()->MovePoint(0, RWORG->GetPositionX()+10,RWORG->GetPositionY()+80,RWORG->GetPositionZ());
DoScriptText(SAY_VICTORY2, m_creature);
}
break;
case 22:
if (Mrfloppy && Mrfloppy->isDead())
{
RWORG->DisappearAndDie();
m_creature->GetMotionMaster()->MovePoint(0, Mrfloppy->GetPositionX(), Mrfloppy->GetPositionY(), Mrfloppy->GetPositionZ());
Mrfloppy->setDeathState(ALIVE);
Mrfloppy->GetMotionMaster()->MoveFollow(m_creature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
DoScriptText(SAY_VICTORY3, m_creature);
}
break;
case 24:
if (pPlayer)
{
Completed = true;
pPlayer->GroupEventHappens(QUEST_PERILOUS_ADVENTURE, m_creature);
DoScriptText(SAY_QUEST_COMPLETE, m_creature, pPlayer);
}
m_creature->RemoveUnitMovementFlag(MOVEMENTFLAG_WALK_MODE);
break;
case 25:
DoScriptText(SAY_VICTORY4, m_creature);
break;
case 27:
m_creature->DisappearAndDie();
if (Mrfloppy)
Mrfloppy->DisappearAndDie();
break;
}
}
void EnterCombat(Unit* Who)
{
DoScriptText(SAY_RANDOMAGGRO, m_creature);
}
void Reset()
{
m_uiChatTimer = 4000;
Mrfloppy = NULL;
RWORG = NULL;
}
void UpdateAI(const uint32 uiDiff)
{
npc_escortAI::UpdateAI(uiDiff);
if (HasEscortState(STATE_ESCORT_ESCORTING))
{
if (m_uiChatTimer <= uiDiff)
{
m_uiChatTimer = 12000;
}
else
m_uiChatTimer -= uiDiff;
}
}
};
bool QuestAccept_npc_emily(Player* pPlayer, Creature* pCreature, Quest const* quest)
{
if (quest->GetQuestId() == QUEST_PERILOUS_ADVENTURE)
{
DoScriptText(SAY_QUEST_ACCEPT, pCreature);
if (Creature* Mrfloppy = GetClosestCreatureWithEntry(pCreature, NPC_MRFLOPPY, 180.0f))
{
Mrfloppy->GetMotionMaster()->MoveFollow(pCreature, PET_FOLLOW_DIST, PET_FOLLOW_ANGLE);
}
if (npc_escortAI* pEscortAI = CAST_AI(npc_emilyAI, (pCreature->AI())))
pEscortAI->Start(true, false, pPlayer->GetGUID());
}
return true;
}
CreatureAI* GetAI_npc_emily(Creature* pCreature)
{
return new npc_emilyAI(pCreature);
}
//mrfloppy
struct npc_mrfloppyAI : public ScriptedAI
{
npc_mrfloppyAI(Creature *c) : ScriptedAI(c) {}
uint64 EmilyGUID;
uint64 RWORGGUID;
uint64 HWORGGUID;
Creature* HWORG;
Creature* RWORG;
Creature* Emily;
void Reset()
{
HWORG = NULL;
RWORG = NULL;
Emily = NULL;
}
void EnterCombat(Unit* Who)
{
if (Creature* Emily = GetClosestCreatureWithEntry(m_creature, NPC_EMILY, 50.0f))
{
switch(Who->GetEntry())
{
case NPC_HUNGRY_WORG:
DoScriptText(SAY_WORGHAGGRO2, Emily);
break;
case NPC_RAVENOUS_WORG:
DoScriptText(SAY_WORGRAGGRO4, Emily);
break;
default:
DoScriptText(SAY_RANDOMAGGRO, Emily);
}
}
}
void EnterEvadeMode() {}
void MoveInLineOfSight(Unit *who) {}
void UpdateAI(const uint32 diff)
{
if (!UpdateVictim())
return;
}
};
CreatureAI* GetAI_npc_mrfloppy(Creature* pCreature)
{
return new npc_mrfloppyAI(pCreature);
}
void AddSC_grizzly_hills() void AddSC_grizzly_hills()
{ {
Script* newscript; Script* newscript;
@@ -124,4 +365,15 @@ void AddSC_grizzly_hills()
newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian; newscript->pGossipHello = &GossipHello_npc_orsonn_and_kodian;
newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian; newscript->pGossipSelect = &GossipSelect_npc_orsonn_and_kodian;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_emily";
newscript->GetAI = &GetAI_npc_emily;
newscript->pQuestAccept = &QuestAccept_npc_emily;
newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "npc_mrfloppy";
newscript->GetAI = &GetAI_npc_mrfloppy;
newscript->RegisterSelf();
} }
+29
View File
@@ -736,6 +736,30 @@ bool GOHello_go_soulwell(Player *pPlayer, GameObject* pGO)
return true; return true;
} }
/*######
## Quest 11560: Oh Noes, the Tadpoles!
## go_tadpole_cage
######*/
enum eTadpoles
{
QUEST_OH_NOES_THE_TADPOLES = 11560,
NPC_WINTERFIN_TADPOLE = 25201
};
bool GOHello_go_tadpole_cage(Player *pPlayer, GameObject *pGO)
{
Creature *pTadpole;
if (pPlayer->GetQuestStatus(QUEST_OH_NOES_THE_TADPOLES) == QUEST_STATUS_INCOMPLETE &&
(pTadpole = pGO->FindNearestCreature(NPC_WINTERFIN_TADPOLE,1.0f)))
{
pGO->UseDoorOrButton();
pTadpole->DisappearAndDie();
pPlayer->KilledMonsterCredit(NPC_WINTERFIN_TADPOLE,0);
//FIX: Summon minion tadpole
}
return true;
}
void AddSC_go_scripts() void AddSC_go_scripts()
{ {
@@ -891,4 +915,9 @@ void AddSC_go_scripts()
newscript->Name = "go_soulwell"; newscript->Name = "go_soulwell";
newscript->pGOHello = &GOHello_go_soulwell; newscript->pGOHello = &GOHello_go_soulwell;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "go_tadpole_cage";
newscript->pGOHello = &GOHello_go_tadpole_cage;
newscript->RegisterSelf();
} }
+75
View File
@@ -316,6 +316,76 @@ bool ItemUse_item_petrov_cluster_bombs(Player* pPlayer, Item* pItem, const Spell
return false; return false;
} }
/*######
# item_dehta_trap_smasher
# For quest 11876, Help Those That Cannot Help Themselves
######*/
enum eHelpThemselves
{
QUEST_CANNOT_HELP_THEMSELVES = 11876,
NPC_TRAPPED_MAMMOTH_CALF = 25850,
GO_MAMMOTH_TRAP_1 = 188022,
GO_MAMMOTH_TRAP_2 = 188024,
GO_MAMMOTH_TRAP_3 = 188025,
GO_MAMMOTH_TRAP_4 = 188026,
GO_MAMMOTH_TRAP_5 = 188027,
GO_MAMMOTH_TRAP_6 = 188028,
GO_MAMMOTH_TRAP_7 = 188029,
GO_MAMMOTH_TRAP_8 = 188030,
GO_MAMMOTH_TRAP_9 = 188031,
GO_MAMMOTH_TRAP_10 = 188032,
GO_MAMMOTH_TRAP_11 = 188033,
GO_MAMMOTH_TRAP_12 = 188034,
GO_MAMMOTH_TRAP_13 = 188035,
GO_MAMMOTH_TRAP_14 = 188036,
GO_MAMMOTH_TRAP_15 = 188037,
GO_MAMMOTH_TRAP_16 = 188038,
GO_MAMMOTH_TRAP_17 = 188039,
GO_MAMMOTH_TRAP_18 = 188040,
GO_MAMMOTH_TRAP_19 = 188041,
GO_MAMMOTH_TRAP_20 = 188042,
GO_MAMMOTH_TRAP_21 = 188043,
GO_MAMMOTH_TRAP_22 = 188044,
};
bool ItemUse_item_dehta_trap_smasher(Player* pPlayer, Item* pItem, const SpellCastTargets &pTargets)
{
Creature* pMammoth;
GameObject* pTrap;
if (pPlayer->GetQuestStatus(QUEST_CANNOT_HELP_THEMSELVES) == QUEST_STATUS_INCOMPLETE &&
(pMammoth = pPlayer->FindNearestCreature(NPC_TRAPPED_MAMMOTH_CALF,5.0f)) &&
((pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_1,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_2,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_3,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_4,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_5,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_6,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_7,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_8,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_9,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_10,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_11,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_12,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_13,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_14,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_15,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_16,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_17,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_18,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_19,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_20,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_21,5.0f)) ||
(pTrap = pPlayer->FindNearestGameObject(GO_MAMMOTH_TRAP_22,5.0f))))
{
pMammoth->AI()->DoAction(1);
pTrap->SetGoState(GO_STATE_READY);
pPlayer->KilledMonsterCredit(NPC_TRAPPED_MAMMOTH_CALF,0);
}
return false;
}
void AddSC_item_scripts() void AddSC_item_scripts()
{ {
Script *newscript; Script *newscript;
@@ -374,4 +444,9 @@ void AddSC_item_scripts()
newscript->Name = "item_petrov_cluster_bombs"; newscript->Name = "item_petrov_cluster_bombs";
newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs; newscript->pItemUse = &ItemUse_item_petrov_cluster_bombs;
newscript->RegisterSelf(); newscript->RegisterSelf();
newscript = new Script;
newscript->Name = "item_dehta_trap_smasher";
newscript->pItemUse = &ItemUse_item_dehta_trap_smasher;
newscript->RegisterSelf();
} }
+98 -86
View File
@@ -103,6 +103,87 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP /Zm200"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\Database;..\..\src\shared\vmap;..\..\dep\ACE_wrappers;..\..\src\game\"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="pchdef.h"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
AssemblerListingLocation=".\game__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\game__$(PlatformName)_$(ConfigurationName)\"
ProgramDataBaseFileName=".\game__$(PlatformName)_$(ConfigurationName)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="0"
CompileAs="0"
ForcedIncludeFiles="pchdef.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_SECURE_SCL=0"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration <Configuration
Name="Debug|x64" Name="Debug|x64"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)" OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
@@ -187,87 +268,6 @@
Name="VCPostBuildEventTool" Name="VCPostBuildEventTool"
/> />
</Configuration> </Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
IntermediateDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
ConfigurationType="4"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/MP /Zm200"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="..\..\dep\include;..\..\src\framework;..\..\src\shared;..\..\src\shared\Database;..\..\src\shared\vmap;..\..\dep\ACE_wrappers;..\..\src\game\"
PreprocessorDefinitions="WIN32;NDEBUG;_LIB;_SECURE_SCL=0"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
EnableEnhancedInstructionSet="1"
RuntimeTypeInfo="true"
UsePrecompiledHeader="2"
PrecompiledHeaderThrough="pchdef.h"
PrecompiledHeaderFile=".\game__$(PlatformName)_$(ConfigurationName)\game.pch"
AssemblerListingLocation=".\game__$(PlatformName)_$(ConfigurationName)\"
ObjectFile=".\game__$(PlatformName)_$(ConfigurationName)\"
ProgramDataBaseFileName=".\game__$(PlatformName)_$(ConfigurationName)\"
WarningLevel="3"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="false"
DebugInformationFormat="3"
CallingConvention="0"
CompileAs="0"
ForcedIncludeFiles="pchdef.h"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;_SECURE_SCL=0"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLibrarianTool"
OutputFile=".\game__$(PlatformName)_$(ConfigurationName)\game.lib"
SuppressStartupBanner="true"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration <Configuration
Name="Release|x64" Name="Release|x64"
OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)" OutputDirectory=".\game__$(PlatformName)_$(ConfigurationName)"
@@ -2888,10 +2888,18 @@
RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\boss_amnennar_the_coldbringer.cpp" RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\boss_amnennar_the_coldbringer.cpp"
> >
</File> </File>
<File
RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\instance_razorfen_downs.cpp"
>
</File>
<File <File
RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\razorfen_downs.cpp" RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\razorfen_downs.cpp"
> >
</File> </File>
<File
RelativePath="..\..\src\scripts\kalimdor\razorfen_downs\razorfen_downs.h"
>
</File>
</Filter> </Filter>
<Filter <Filter
Name="Razorfen Kraul" Name="Razorfen Kraul"
@@ -3152,6 +3160,10 @@
<Filter <Filter
Name="Forge of Souls" Name="Forge of Souls"
> >
<File
RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\boss_bronjahm.cpp"
>
</File>
<File <File
RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\forge_of_souls.h" RelativePath="..\..\src\scripts\northrend\frozen_halls\forge_of_souls\forge_of_souls.h"
> >
@@ -3177,12 +3189,12 @@
Name="Pit of Saron" Name="Pit of Saron"
> >
<File <File
RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\pit_of_saron.h" RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\instance_pit_of_saron.cpp"
> >
</File> </File>
<File <File
RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\instance_pit_of_saron.cpp" RelativePath="..\..\src\scripts\northrend\frozen_halls\pit_of_saron\pit_of_saron.h"
> >
</File> </File>
</Filter> </Filter>
<Filter <Filter
@@ -4148,7 +4160,7 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Debug|x64" Name="Release|Win32"
> >
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"
@@ -4157,7 +4169,7 @@
/> />
</FileConfiguration> </FileConfiguration>
<FileConfiguration <FileConfiguration
Name="Release|Win32" Name="Debug|x64"
> >
<Tool <Tool
Name="VCCLCompilerTool" Name="VCCLCompilerTool"