Merge remote branch 'origin/master' into 330

Conflicts:
	src/game/Player.cpp
This commit is contained in:
tomrus88 2010-03-27 13:29:31 +03:00
commit 112046718a
25 changed files with 120 additions and 157 deletions

View file

@ -24,7 +24,7 @@ CREATE TABLE `db_version` (
`version` varchar(120) default NULL, `version` varchar(120) default NULL,
`creature_ai_version` varchar(120) default NULL, `creature_ai_version` varchar(120) default NULL,
`cache_id` int(10) default '0', `cache_id` int(10) default '0',
`required_9590_01_mangos_db_script_string` bit(1) default NULL `required_9622_01_mangos_gameobject` bit(1) default NULL
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Used DB version notes';
-- --
@ -1702,7 +1702,9 @@ CREATE TABLE `gameobject` (
`spawntimesecs` int(11) NOT NULL default '0', `spawntimesecs` int(11) NOT NULL default '0',
`animprogress` tinyint(3) unsigned NOT NULL default '0', `animprogress` tinyint(3) unsigned NOT NULL default '0',
`state` tinyint(3) unsigned NOT NULL default '0', `state` tinyint(3) unsigned NOT NULL default '0',
PRIMARY KEY (`guid`) PRIMARY KEY (`guid`),
KEY `idx_map` (`map`),
KEY `idx_id` (`id`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System'; ) ENGINE=MyISAM DEFAULT CHARSET=utf8 ROW_FORMAT=FIXED COMMENT='Gameobject System';
-- --

View file

@ -1,4 +1,4 @@
ALTER TABLE db_version CHANGE COLUMN required_9288_01_mangos_spell_bonus_data required_9289_01_mangos_spell_proc_event bit; ALTER TABLE db_version CHANGE COLUMN required_9288_01_mangos_spell_bonus_data required_9289_01_mangos_spell_proc_event bit;
DELETE FROM `spell_proc_event` WHERE `entry` IN (57870); DELETE FROM `spell_proc_event` WHERE `entry` IN (57870);
INSERT INTO `spell_proc_event` VALUES INSERT INTO `spell_proc_event` VALUES
(57870, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0.000000, 0.000000, 0); (57870, 0x00000000, 9, 0x00800000, 0x00000000, 0x00000000, 0x00040000, 0x00000000, 0.000000, 0.000000, 0);

View file

@ -6,4 +6,4 @@ ALTER TABLE spell_bonus_data
DELETE FROM spell_bonus_data WHERE entry = 71824; DELETE FROM spell_bonus_data WHERE entry = 71824;
INSERT INTO spell_bonus_data VALUES INSERT INTO spell_bonus_data VALUES
(71824,0,0,0,'Item - Shaman T9 Elemental 4P Bonus'); (71824,0,0,0,'Item - Shaman T9 Elemental 4P Bonus');

View file

@ -2,4 +2,5 @@ ALTER TABLE db_version CHANGE COLUMN required_9366_01_mangos_spell_bonus_data re
DELETE FROM `spell_proc_event` WHERE `entry` = 67228; DELETE FROM `spell_proc_event` WHERE `entry` = 67228;
INSERT INTO `spell_proc_event` VALUES INSERT INTO `spell_proc_event` VALUES
(67228, 0x00000004, 11, 0x00000000, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0); (67228, 0x00000004, 11, 0x00000000, 0x00001000, 0x00000000, 0x00000000, 0x00000000, 0.000000, 0.000000, 0);

View file

@ -2,4 +2,4 @@ ALTER TABLE db_version CHANGE COLUMN required_9366_02_mangos_spell_proc_event re
DELETE FROM `spell_proc_event` WHERE `entry` = 65661; DELETE FROM `spell_proc_event` WHERE `entry` = 65661;
INSERT INTO `spell_proc_event` VALUES INSERT INTO `spell_proc_event` VALUES
(65661, 0x00000000, 15, 0x00400011 ,0x20020004 ,0x00000000, 0x00000010, 0x00000000, 0.000000, 100.000000, 0); (65661, 0x00000000, 15, 0x00400011 ,0x20020004 ,0x00000000, 0x00000010, 0x00000000, 0.000000, 100.000000, 0);

View file

@ -4,4 +4,4 @@ alter table item_template
add column NonConsumable tinyint(1) UNSIGNED DEFAULT '0' NOT NULL after maxMoneyLoot; add column NonConsumable tinyint(1) UNSIGNED DEFAULT '0' NOT NULL after maxMoneyLoot;
update item_template update item_template
set NonConsumable = 1 WHERE ItemLimitCategory = 4; set NonConsumable = 1 WHERE ItemLimitCategory = 4;

View file

@ -3,4 +3,4 @@ ALTER TABLE db_version CHANGE COLUMN required_9509_01_mangos_item_template requi
DELETE FROM `spell_proc_event` WHERE `entry` IN (16952, 16954); DELETE FROM `spell_proc_event` WHERE `entry` IN (16952, 16954);
INSERT INTO `spell_proc_event` VALUES INSERT INTO `spell_proc_event` VALUES
(16952, 0x00000000, 7, 0x00039000, 0x00000400, 0x00000000, 0x00040000, 0x00000002, 0.000000, 0.000000, 0), (16952, 0x00000000, 7, 0x00039000, 0x00000400, 0x00000000, 0x00040000, 0x00000002, 0.000000, 0.000000, 0),
(16954, 0x00000000, 7, 0x00039000, 0x00000400, 0x00000000, 0x00040000, 0x00000002, 0.000000, 0.000000, 0); (16954, 0x00000000, 7, 0x00039000, 0x00000400, 0x00000000, 0x00040000, 0x00000002, 0.000000, 0.000000, 0);

View file

@ -3,4 +3,4 @@ ALTER TABLE db_version CHANGE COLUMN required_9512_01_mangos_spell_proc_event re
DELETE FROM `spell_proc_event` WHERE `entry` IN (16952, 16954); DELETE FROM `spell_proc_event` WHERE `entry` IN (16952, 16954);
INSERT INTO `spell_proc_event` VALUES INSERT INTO `spell_proc_event` VALUES
(16952, 0x00000000, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0), (16952, 0x00000000, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0),
(16954, 0x00000000, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0); (16954, 0x00000000, 7, 0x00039000, 0x00000400, 0x00040000, 0x00000000, 0x00000002, 0.000000, 0.000000, 0);

View file

@ -12,4 +12,4 @@ ALTER TABLE `guild_bank_item` ADD INDEX `Idx_item_guid`(`item_guid`);
ALTER TABLE `corpse` ADD INDEX `Idx_player`(`player`); ALTER TABLE `corpse` ADD INDEX `Idx_player`(`player`);
ALTER TABLE `corpse` ADD INDEX `Idx_time`(`time`); ALTER TABLE `corpse` ADD INDEX `Idx_time`(`time`);
ALTER TABLE `guild_rank` ADD INDEX `Idx_rid`(`rid`); ALTER TABLE `guild_rank` ADD INDEX `Idx_rid`(`rid`);
ALTER TABLE `character_equipmentsets` ADD INDEX `Idx_setindex` (`setindex`); ALTER TABLE `character_equipmentsets` ADD INDEX `Idx_setindex` (`setindex`);

View file

@ -0,0 +1,4 @@
ALTER TABLE db_version CHANGE COLUMN required_9590_01_mangos_db_script_string required_9622_01_mangos_gameobject bit;
ALTER TABLE gameobject ADD KEY idx_map(map);
ALTER TABLE gameobject ADD KEY idx_id(id);

View file

@ -90,6 +90,7 @@ pkgdata_DATA = \
9589_01_mangos_creature_template.sql \ 9589_01_mangos_creature_template.sql \
9590_01_mangos_db_script_string.sql \ 9590_01_mangos_db_script_string.sql \
9611_01_characters.sql \ 9611_01_characters.sql \
9622_01_mangos_gameobject.sql \
README README
## Additional files to include when running 'make dist' ## Additional files to include when running 'make dist'
@ -160,4 +161,5 @@ EXTRA_DIST = \
9589_01_mangos_creature_template.sql \ 9589_01_mangos_creature_template.sql \
9590_01_mangos_db_script_string.sql \ 9590_01_mangos_db_script_string.sql \
9611_01_characters.sql \ 9611_01_characters.sql \
9622_01_mangos_gameobject.sql \
README README

View file

@ -97,6 +97,8 @@ bool LoginQueryHolder::Initialize()
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, "SELECT type, time, data FROM character_account_data WHERE guid='%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADACCOUNTDATA, "SELECT type, time, data FROM character_account_data WHERE guid='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADSKILLS, "SELECT skill, value, max FROM character_skills WHERE guid = '%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGLYPHS, "SELECT spec, slot, glyph FROM character_glyphs WHERE guid='%u'", GUID_LOPART(m_guid)); res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADGLYPHS, "SELECT spec, slot, glyph FROM character_glyphs WHERE guid='%u'", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILS, "SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GUID_LOPART(m_guid));
res &= SetPQuery(PLAYER_LOGIN_QUERY_LOADMAILEDITEMS, "SELECT data, mail_id, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE receiver = '%u'", GUID_LOPART(m_guid));
return res; return res;
} }

View file

@ -4889,18 +4889,18 @@ bool ChatHandler::HandleQuestComplete(const char* args)
if(uint32 spell_id = pQuest->ReqSpell[i]) if(uint32 spell_id = pQuest->ReqSpell[i])
{ {
for(uint16 z = 0; z < creaturecount; ++z) for(uint16 z = 0; z < creaturecount; ++z)
player->CastedCreatureOrGO(creature, ObjectGuid::EmptyGuid, spell_id); player->CastedCreatureOrGO(creature, ObjectGuid(), spell_id);
} }
else if(creature > 0) else if(creature > 0)
{ {
if(CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creature)) if(CreatureInfo const* cInfo = ObjectMgr::GetCreatureTemplate(creature))
for(uint16 z = 0; z < creaturecount; ++z) for(uint16 z = 0; z < creaturecount; ++z)
player->KilledMonster(cInfo, ObjectGuid::EmptyGuid); player->KilledMonster(cInfo, ObjectGuid());
} }
else if(creature < 0) else if(creature < 0)
{ {
for(uint16 z = 0; z < creaturecount; ++z) for(uint16 z = 0; z < creaturecount; ++z)
player->CastedCreatureOrGO(-creature, ObjectGuid::EmptyGuid, 0); player->CastedCreatureOrGO(-creature, ObjectGuid(), 0);
} }
} }

View file

@ -214,11 +214,11 @@ void MotionMaster::MoveRandom()
{ {
if (i_owner->GetTypeId() == TYPEID_PLAYER) if (i_owner->GetTypeId() == TYPEID_PLAYER)
{ {
sLog.outError("Player (GUID: %u) attempt to move random.", i_owner->GetGUIDLow()); sLog.outError("%s attempt to move random.", i_owner->GetObjectGuid().GetString().c_str());
} }
else else
{ {
DEBUG_LOG("Creature (Entry: %u GUID: %u) move random.", i_owner->GetEntry(), i_owner->GetGUIDLow()); DEBUG_LOG("%s move random.", i_owner->GetObjectGuid().GetString().c_str());
Mutate(new RandomMovementGenerator<Creature>(*i_owner)); Mutate(new RandomMovementGenerator<Creature>(*i_owner));
} }
} }
@ -233,42 +233,34 @@ MotionMaster::MoveTargetedHome()
if(i_owner->GetTypeId()==TYPEID_UNIT && !((Creature*)i_owner)->GetCharmerOrOwnerGUID()) if(i_owner->GetTypeId()==TYPEID_UNIT && !((Creature*)i_owner)->GetCharmerOrOwnerGUID())
{ {
DEBUG_LOG("Creature (Entry: %u GUID: %u) targeted home", i_owner->GetEntry(), i_owner->GetGUIDLow()); DEBUG_LOG("%s targeted home", i_owner->GetObjectGuid().GetString().c_str());
Mutate(new HomeMovementGenerator<Creature>()); Mutate(new HomeMovementGenerator<Creature>());
} }
else if(i_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)i_owner)->GetCharmerOrOwnerGUID()) else if(i_owner->GetTypeId()==TYPEID_UNIT && ((Creature*)i_owner)->GetCharmerOrOwnerGUID())
{ {
DEBUG_LOG("Pet or controlled creature (Entry: %u GUID: %u) targeting home", if (Unit *target = ((Creature*)i_owner)->GetCharmerOrOwner())
i_owner->GetEntry(), i_owner->GetGUIDLow() );
Unit *target = ((Creature*)i_owner)->GetCharmerOrOwner();
if(target)
{ {
DEBUG_LOG("Following %s (GUID: %u)", DEBUG_LOG("%s follow to %s", i_owner->GetObjectGuid().GetString().c_str(), target->GetObjectGuid().GetString().c_str());
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE)); Mutate(new FollowMovementGenerator<Creature>(*target,PET_FOLLOW_DIST,PET_FOLLOW_ANGLE));
} }
else
{
DEBUG_LOG("%s attempt but fail to follow owner", i_owner->GetObjectGuid().GetString().c_str());
}
} }
else else
{ sLog.outError("%s attempt targeted home", i_owner->GetObjectGuid().GetString().c_str());
sLog.outError("Player (GUID: %u) attempt targeted home", i_owner->GetGUIDLow() );
}
} }
void void
MotionMaster::MoveConfused() MotionMaster::MoveConfused()
{ {
DEBUG_LOG("%s move confused", i_owner->GetObjectGuid().GetString().c_str());
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{
DEBUG_LOG("Player (GUID: %u) move confused", i_owner->GetGUIDLow() );
Mutate(new ConfusedMovementGenerator<Player>()); Mutate(new ConfusedMovementGenerator<Player>());
}
else else
{
DEBUG_LOG("Creature (Entry: %u GUID: %u) move confused",
i_owner->GetEntry(), i_owner->GetGUIDLow() );
Mutate(new ConfusedMovementGenerator<Creature>()); Mutate(new ConfusedMovementGenerator<Creature>());
}
} }
void void
@ -278,22 +270,12 @@ MotionMaster::MoveChase(Unit* target, float dist, float angle)
if(!target) if(!target)
return; return;
DEBUG_LOG("%s chase to %s", i_owner->GetObjectGuid().GetString().c_str(), target->GetObjectGuid().GetString().c_str());
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{
DEBUG_LOG("Player (GUID: %u) chase to %s (GUID: %u)",
i_owner->GetGUIDLow(),
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? i_owner->GetGUIDLow() : ((Creature*)i_owner)->GetDBTableGUIDLow() );
Mutate(new ChaseMovementGenerator<Player>(*target,dist,angle)); Mutate(new ChaseMovementGenerator<Player>(*target,dist,angle));
}
else else
{
DEBUG_LOG("Creature (Entry: %u GUID: %u) chase to %s (GUID: %u)",
i_owner->GetEntry(), i_owner->GetGUIDLow(),
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
Mutate(new ChaseMovementGenerator<Creature>(*target,dist,angle)); Mutate(new ChaseMovementGenerator<Creature>(*target,dist,angle));
}
} }
void void
@ -305,37 +287,23 @@ MotionMaster::MoveFollow(Unit* target, float dist, float angle)
if(!target) if(!target)
return; return;
DEBUG_LOG("%s follow to %s", i_owner->GetObjectGuid().GetString().c_str(), target->GetObjectGuid().GetString().c_str());
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{
DEBUG_LOG("Player (GUID: %u) follow to %s (GUID: %u)", i_owner->GetGUIDLow(),
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? i_owner->GetGUIDLow() : ((Creature*)i_owner)->GetDBTableGUIDLow() );
Mutate(new FollowMovementGenerator<Player>(*target,dist,angle)); Mutate(new FollowMovementGenerator<Player>(*target,dist,angle));
}
else else
{
DEBUG_LOG("Creature (Entry: %u GUID: %u) follow to %s (GUID: %u)",
i_owner->GetEntry(), i_owner->GetGUIDLow(),
target->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
target->GetTypeId()==TYPEID_PLAYER ? target->GetGUIDLow() : ((Creature*)target)->GetDBTableGUIDLow() );
Mutate(new FollowMovementGenerator<Creature>(*target,dist,angle)); Mutate(new FollowMovementGenerator<Creature>(*target,dist,angle));
}
} }
void void
MotionMaster::MovePoint(uint32 id, float x, float y, float z) MotionMaster::MovePoint(uint32 id, float x, float y, float z)
{ {
DEBUG_LOG("%s targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetObjectGuid().GetString().c_str(), id, x, y, z );
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{
DEBUG_LOG("Player (GUID: %u) targeted point (Id: %u X: %f Y: %f Z: %f)", i_owner->GetGUIDLow(), id, x, y, z );
Mutate(new PointMovementGenerator<Player>(id,x,y,z)); Mutate(new PointMovementGenerator<Player>(id,x,y,z));
}
else else
{
DEBUG_LOG("Creature (Entry: %u GUID: %u) targeted point (ID: %u X: %f Y: %f Z: %f)",
i_owner->GetEntry(), i_owner->GetGUIDLow(), id, x, y, z );
Mutate(new PointMovementGenerator<Creature>(id,x,y,z)); Mutate(new PointMovementGenerator<Creature>(id,x,y,z));
}
} }
void void
@ -343,12 +311,12 @@ MotionMaster::MoveSeekAssistance(float x, float y, float z)
{ {
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{ {
sLog.outError("Player (GUID: %u) attempt to seek assistance",i_owner->GetGUIDLow()); sLog.outError("%s attempt to seek assistance",i_owner->GetObjectGuid().GetString().c_str());
} }
else else
{ {
DEBUG_LOG("Creature (Entry: %u GUID: %u) seek assistance (X: %f Y: %f Z: %f)", DEBUG_LOG("%s seek assistance (X: %f Y: %f Z: %f)",
i_owner->GetEntry(), i_owner->GetGUIDLow(), x, y, z ); i_owner->GetObjectGuid().GetString().c_str(), x, y, z );
Mutate(new AssistanceMovementGenerator(x,y,z)); Mutate(new AssistanceMovementGenerator(x,y,z));
} }
} }
@ -358,12 +326,12 @@ MotionMaster::MoveSeekAssistanceDistract(uint32 time)
{ {
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{ {
sLog.outError("Player (GUID: %u) attempt to call distract after assistance",i_owner->GetGUIDLow()); sLog.outError("%s attempt to call distract after assistance",i_owner->GetObjectGuid().GetString().c_str());
} }
else else
{ {
DEBUG_LOG("Creature (Entry: %u GUID: %u) is distracted after assistance call (Time: %u)", DEBUG_LOG("%s is distracted after assistance call (Time: %u)",
i_owner->GetEntry(), i_owner->GetGUIDLow(), time ); i_owner->GetObjectGuid().GetString().c_str(), time );
Mutate(new AssistanceDistractMovementGenerator(time)); Mutate(new AssistanceDistractMovementGenerator(time));
} }
} }
@ -374,20 +342,12 @@ MotionMaster::MoveFleeing(Unit* enemy, uint32 time)
if(!enemy) if(!enemy)
return; return;
DEBUG_LOG("%s flee from %s", i_owner->GetObjectGuid().GetString().c_str(), enemy->GetObjectGuid().GetString().c_str());
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{
DEBUG_LOG("Player (GUID: %u) flee from %s (GUID: %u)", i_owner->GetGUIDLow(),
enemy->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId()==TYPEID_PLAYER ? enemy->GetGUIDLow() : ((Creature*)enemy)->GetDBTableGUIDLow() );
Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID())); Mutate(new FleeingMovementGenerator<Player>(enemy->GetGUID()));
}
else else
{ {
DEBUG_LOG("Creature (Entry: %u GUID: %u) flee from %s (GUID: %u)%s",
i_owner->GetEntry(), i_owner->GetGUIDLow(),
enemy->GetTypeId()==TYPEID_PLAYER ? "player" : "creature",
enemy->GetTypeId()==TYPEID_PLAYER ? enemy->GetGUIDLow() : ((Creature*)enemy)->GetDBTableGUIDLow(),
time ? " for a limited time" : "");
if (time) if (time)
Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time)); Mutate(new TimedFleeingMovementGenerator(enemy->GetGUID(), time));
else else
@ -400,30 +360,21 @@ MotionMaster::MoveTaxiFlight(uint32 path, uint32 pathnode)
{ {
if(i_owner->GetTypeId()==TYPEID_PLAYER) if(i_owner->GetTypeId()==TYPEID_PLAYER)
{ {
DEBUG_LOG("Player (GUID: %u) taxi to (Path %u node %u)", i_owner->GetGUIDLow(), path, pathnode); DEBUG_LOG("%s taxi to (Path %u node %u)", i_owner->GetObjectGuid().GetString().c_str(), path, pathnode);
FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(path,pathnode); FlightPathMovementGenerator* mgen = new FlightPathMovementGenerator(path,pathnode);
Mutate(mgen); Mutate(mgen);
} }
else else
{ {
sLog.outError("Creature (Entry: %u GUID: %u) attempt taxi to (Path %u node %u)", sLog.outError("%s attempt taxi to (Path %u node %u)",
i_owner->GetEntry(), i_owner->GetGUIDLow(), path, pathnode ); i_owner->GetObjectGuid().GetString().c_str(), path, pathnode );
} }
} }
void void
MotionMaster::MoveDistract(uint32 timer) MotionMaster::MoveDistract(uint32 timer)
{ {
if(i_owner->GetTypeId()==TYPEID_PLAYER) DEBUG_LOG("%s distracted (timer: %u)", i_owner->GetObjectGuid().GetString().c_str(), timer);
{
DEBUG_LOG("Player (GUID: %u) distracted (timer: %u)", i_owner->GetGUIDLow(), timer);
}
else
{
DEBUG_LOG("Creature (Entry: %u GUID: %u) (timer: %u)",
i_owner->GetEntry(), i_owner->GetGUIDLow(), timer);
}
DistractMovementGenerator* mgen = new DistractMovementGenerator(timer); DistractMovementGenerator* mgen = new DistractMovementGenerator(timer);
Mutate(mgen); Mutate(mgen);
} }

View file

@ -22,8 +22,6 @@
#include <sstream> #include <sstream>
ObjectGuid const ObjectGuid::EmptyGuid;
char const* ObjectGuid::GetTypeName(HighGuid high) char const* ObjectGuid::GetTypeName(HighGuid high)
{ {
switch(high) switch(high)

View file

@ -114,7 +114,7 @@ struct PackedGuidReader
ObjectGuid* m_guidPtr; ObjectGuid* m_guidPtr;
}; };
class ObjectGuid class MANGOS_DLL_SPEC ObjectGuid
{ {
public: // constructors public: // constructors
ObjectGuid() : m_guid(0) {} ObjectGuid() : m_guid(0) {}
@ -122,9 +122,6 @@ class ObjectGuid
ObjectGuid(HighGuid hi, uint32 entry, uint32 counter) : m_guid(uint64(counter) | (uint64(entry) << 24) | (uint64(hi) << 48)) {} ObjectGuid(HighGuid hi, uint32 entry, uint32 counter) : m_guid(uint64(counter) | (uint64(entry) << 24) | (uint64(hi) << 48)) {}
ObjectGuid(HighGuid hi, uint32 counter) : m_guid(uint64(counter) | (uint64(hi) << 48)) {} ObjectGuid(HighGuid hi, uint32 counter) : m_guid(uint64(counter) | (uint64(hi) << 48)) {}
public: // statics
static ObjectGuid const EmptyGuid;
public: // modifiers public: // modifiers
PackedGuidReader ReadAsPacked() { return PackedGuidReader(*this); } PackedGuidReader ReadAsPacked() { return PackedGuidReader(*this); }

View file

@ -15107,7 +15107,8 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
// apply original stats mods before spell loading or item equipment that call before equip _RemoveStatsMods() // apply original stats mods before spell loading or item equipment that call before equip _RemoveStatsMods()
// Mail // Mail
_LoadMail(); _LoadMails(holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILS));
_LoadMailedItems(holder->GetResult(PLAYER_LOGIN_QUERY_LOADMAILEDITEMS));
UpdateNextMailTimeAndUnreads(); UpdateNextMailTimeAndUnreads();
m_specsCount = fields[59].GetUInt8(); m_specsCount = fields[59].GetUInt8();
@ -15657,19 +15658,24 @@ void Player::_LoadInventory(QueryResult *result, uint32 timediff)
} }
// load mailed item which should receive current player // load mailed item which should receive current player
void Player::_LoadMailedItems(Mail *mail) void Player::_LoadMailedItems(QueryResult *result)
{ {
// data needs to be at first place for Item::LoadFromDB // data needs to be at first place for Item::LoadFromDB
QueryResult* result = CharacterDatabase.PQuery("SELECT data, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE mail_id='%u'", mail->messageID); // 0 1 2 3
// "SELECT data, mail_id, item_guid, item_template FROM mail_items JOIN item_instance ON item_guid = guid WHERE receiver = '%u'", GUID_LOPART(m_guid)
if(!result) if(!result)
return; return;
do do
{ {
Field *fields = result->Fetch(); Field *fields = result->Fetch();
uint32 item_guid_low = fields[1].GetUInt32(); uint32 mail_id = fields[1].GetUInt32();
uint32 item_template = fields[2].GetUInt32(); uint32 item_guid_low = fields[2].GetUInt32();
uint32 item_template = fields[3].GetUInt32();
Mail* mail = GetMail(mail_id);
if(!mail)
continue;
mail->AddItem(item_guid_low, item_template); mail->AddItem(item_guid_low, item_template);
ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template); ItemPrototype const *proto = ObjectMgr::GetItemPrototype(item_template);
@ -15699,47 +15705,44 @@ void Player::_LoadMailedItems(Mail *mail)
delete result; delete result;
} }
void Player::_LoadMail() void Player::_LoadMails(QueryResult *result)
{ {
m_mail.clear(); m_mail.clear();
//mails are in right order 0 1 2 3 4 5 6 7 8 9 10 11 12 13 // 0 1 2 3 4 5 6 7 8 9 10 11 12 13
QueryResult *result = CharacterDatabase.PQuery("SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow()); //"SELECT id,messageType,sender,receiver,subject,body,has_items,expire_time,deliver_time,money,cod,checked,stationery,mailTemplateId FROM mail WHERE receiver = '%u' ORDER BY id DESC", GetGUIDLow()
if(result) if(!result)
return;
do
{ {
do Field *fields = result->Fetch();
Mail *m = new Mail;
m->messageID = fields[0].GetUInt32();
m->messageType = fields[1].GetUInt8();
m->sender = fields[2].GetUInt32();
m->receiver = fields[3].GetUInt32();
m->subject = fields[4].GetCppString();
m->body = fields[5].GetUInt32();
bool has_items = fields[6].GetBool();
m->expire_time = (time_t)fields[7].GetUInt64();
m->deliver_time = (time_t)fields[8].GetUInt64();
m->money = fields[9].GetUInt32();
m->COD = fields[10].GetUInt32();
m->checked = fields[11].GetUInt32();
m->stationery = fields[12].GetUInt8();
m->mailTemplateId = fields[13].GetInt16();
if(m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId))
{ {
Field *fields = result->Fetch(); sLog.outError( "Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
Mail *m = new Mail; m->mailTemplateId = 0;
m->messageID = fields[0].GetUInt32(); }
m->messageType = fields[1].GetUInt8();
m->sender = fields[2].GetUInt32();
m->receiver = fields[3].GetUInt32();
m->subject = fields[4].GetCppString();
m->body = fields[5].GetCppString();
bool has_items = fields[6].GetBool();
m->expire_time = (time_t)fields[7].GetUInt64();
m->deliver_time = (time_t)fields[8].GetUInt64();
m->money = fields[9].GetUInt32();
m->COD = fields[10].GetUInt32();
m->checked = fields[11].GetUInt32();
m->stationery = fields[12].GetUInt8();
m->mailTemplateId = fields[13].GetInt16();
if(m->mailTemplateId && !sMailTemplateStore.LookupEntry(m->mailTemplateId)) m->state = MAIL_STATE_UNCHANGED;
{
sLog.outError( "Player::_LoadMail - Mail (%u) have not existed MailTemplateId (%u), remove at load", m->messageID, m->mailTemplateId);
m->mailTemplateId = 0;
}
m->state = MAIL_STATE_UNCHANGED; m_mail.push_back(m);
} while( result->NextRow() );
if (has_items) delete result;
_LoadMailedItems(m);
m_mail.push_back(m);
} while( result->NextRow() );
delete result;
}
} }
void Player::LoadPet() void Player::LoadPet()

View file

@ -889,7 +889,9 @@ enum PlayerLoginQueryIndex
PLAYER_LOGIN_QUERY_LOADACCOUNTDATA = 20, PLAYER_LOGIN_QUERY_LOADACCOUNTDATA = 20,
PLAYER_LOGIN_QUERY_LOADSKILLS = 21, PLAYER_LOGIN_QUERY_LOADSKILLS = 21,
PLAYER_LOGIN_QUERY_LOADGLYPHS = 22, PLAYER_LOGIN_QUERY_LOADGLYPHS = 22,
MAX_PLAYER_LOGIN_QUERY = 23 PLAYER_LOGIN_QUERY_LOADMAILS = 23,
PLAYER_LOGIN_QUERY_LOADMAILEDITEMS = 24,
MAX_PLAYER_LOGIN_QUERY = 25
}; };
enum PlayerDelayedOperations enum PlayerDelayedOperations
@ -2315,8 +2317,8 @@ class MANGOS_DLL_SPEC Player : public Unit
void _LoadAuras(QueryResult *result, uint32 timediff); void _LoadAuras(QueryResult *result, uint32 timediff);
void _LoadBoundInstances(QueryResult *result); void _LoadBoundInstances(QueryResult *result);
void _LoadInventory(QueryResult *result, uint32 timediff); void _LoadInventory(QueryResult *result, uint32 timediff);
void _LoadMail(); void _LoadMails(QueryResult *result);
void _LoadMailedItems(Mail *mail); void _LoadMailedItems(QueryResult *result);
void _LoadQuestStatus(QueryResult *result); void _LoadQuestStatus(QueryResult *result);
void _LoadDailyQuestStatus(QueryResult *result); void _LoadDailyQuestStatus(QueryResult *result);
void _LoadGroup(QueryResult *result); void _LoadGroup(QueryResult *result);

View file

@ -358,7 +358,7 @@ class Spell
void EffectSpecCount(SpellEffectIndex eff_idx); void EffectSpecCount(SpellEffectIndex eff_idx);
void EffectActivateSpec(SpellEffectIndex eff_idx); void EffectActivateSpec(SpellEffectIndex eff_idx);
Spell( Unit* Caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid::EmptyGuid, Spell** triggeringContainer = NULL ); Spell( Unit* Caster, SpellEntry const *info, bool triggered, ObjectGuid originalCasterGUID = ObjectGuid(), Spell** triggeringContainer = NULL );
~Spell(); ~Spell();
void prepare(SpellCastTargets const* targets, Aura* triggeredByAura = NULL); void prepare(SpellCastTargets const* targets, Aura* triggeredByAura = NULL);

View file

@ -25,7 +25,7 @@
class TemporarySummon : public Creature class TemporarySummon : public Creature
{ {
public: public:
explicit TemporarySummon(ObjectGuid summoner = ObjectGuid::EmptyGuid); explicit TemporarySummon(ObjectGuid summoner = ObjectGuid());
virtual ~TemporarySummon(){}; virtual ~TemporarySummon(){};
void Update(uint32 time); void Update(uint32 time);
void Summon(TempSummonType type, uint32 lifetime); void Summon(TempSummonType type, uint32 lifetime);

View file

@ -369,16 +369,16 @@ void Unit::SendMonsterMove(float NewPosX, float NewPosY, float NewPosZ, SplineTy
return; return;
case SPLINETYPE_FACINGSPOT: // facing spot, not used currently case SPLINETYPE_FACINGSPOT: // facing spot, not used currently
{ {
data << float(va_arg(vargs,float)); data << float(va_arg(vargs,double));
data << float(va_arg(vargs,float)); data << float(va_arg(vargs,double));
data << float(va_arg(vargs,float)); data << float(va_arg(vargs,double));
break; break;
} }
case SPLINETYPE_FACINGTARGET: case SPLINETYPE_FACINGTARGET:
data << uint64(va_arg(vargs,uint64)); data << uint64(va_arg(vargs,uint64));
break; break;
case SPLINETYPE_FACINGANGLE: // not used currently case SPLINETYPE_FACINGANGLE: // not used currently
data << float(va_arg(vargs,float)); // facing angle data << float(va_arg(vargs,double)); // facing angle
break; break;
} }
@ -1074,7 +1074,7 @@ void Unit::CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castIte
return; return;
} }
CastSpell(Victim, sSpellStore.LookupEntry(spellId), triggered, castItem, triggeredByAura, originalCaster); CastSpell(Victim, spellInfo, triggered, castItem, triggeredByAura, originalCaster);
} }
void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster) void Unit::CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem, Aura* triggeredByAura, ObjectGuid originalCaster)

View file

@ -1352,12 +1352,12 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype); void SendEnergizeSpellLog(Unit *pVictim, uint32 SpellID, uint32 Damage,Powers powertype);
void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype); void EnergizeBySpell(Unit *pVictim, uint32 SpellID, uint32 Damage, Powers powertype);
uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage); uint32 SpellNonMeleeDamageLog(Unit *pVictim, uint32 spellID, uint32 damage);
void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::EmptyGuid); void CastSpell(Unit* Victim, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::EmptyGuid); void CastSpell(Unit* Victim,SpellEntry const *spellInfo, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::EmptyGuid); void CastCustomSpell(Unit* Victim, uint32 spellId, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::EmptyGuid); void CastCustomSpell(Unit* Victim,SpellEntry const *spellInfo, int32 const* bp0, int32 const* bp1, int32 const* bp2, bool triggered, Item *castItem= NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::EmptyGuid); void CastSpell(float x, float y, float z, uint32 spellId, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid::EmptyGuid); void CastSpell(float x, float y, float z, SpellEntry const *spellInfo, bool triggered, Item *castItem = NULL, Aura* triggeredByAura = NULL, ObjectGuid originalCaster = ObjectGuid());
bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const; bool IsDamageToThreatSpell(SpellEntry const * spellInfo) const;
@ -1376,6 +1376,7 @@ class MANGOS_DLL_SPEC Unit : public WorldObject
void MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0); void MonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0);
// recommend use MonsterMove/MonsterMoveWithSpeed for most case that correctly work with movegens // recommend use MonsterMove/MonsterMoveWithSpeed for most case that correctly work with movegens
// if used additional args in ... part then floats must explicitly casted to double
void SendMonsterMove(float x, float y, float z, SplineType type, SplineFlags flags, uint32 Time, Player* player = NULL, ...); void SendMonsterMove(float x, float y, float z, SplineType type, SplineFlags flags, uint32 Time, Player* player = NULL, ...);
void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, SplineFlags flags); void SendMonsterMoveByPath(Path const& path, uint32 start, uint32 end, SplineFlags flags);
void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL); void SendMonsterMoveWithSpeed(float x, float y, float z, uint32 transitTime = 0, Player* player = NULL);

View file

@ -439,7 +439,7 @@ LogColors = ""
# #
# MinLevelForHeroicCharacterCreating # MinLevelForHeroicCharacterCreating
# Limit creating heroic characters only for account with another character of specific level (ignored for GM accounts) # Limit creating heroic characters only for account with another character of specific level (ignored for GM accounts)
# 0 - not require any existed chaarcter # 0 - not require any existed character
# 1 - require at least any character existed # 1 - require at least any character existed
# Default: 55 - default requirement # Default: 55 - default requirement
# #

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__ #ifndef __REVISION_NR_H__
#define __REVISION_NR_H__ #define __REVISION_NR_H__
#define REVISION_NR "9619" #define REVISION_NR "9627"
#endif // __REVISION_NR_H__ #endif // __REVISION_NR_H__

View file

@ -1,6 +1,6 @@
#ifndef __REVISION_SQL_H__ #ifndef __REVISION_SQL_H__
#define __REVISION_SQL_H__ #define __REVISION_SQL_H__
#define REVISION_DB_CHARACTERS "required_9611_01_characters" #define REVISION_DB_CHARACTERS "required_9611_01_characters"
#define REVISION_DB_MANGOS "required_9590_01_mangos_db_script_string" #define REVISION_DB_MANGOS "required_9622_01_mangos_gameobject"
#define REVISION_DB_REALMD "required_9010_01_realmd_realmlist" #define REVISION_DB_REALMD "required_9010_01_realmd_realmlist"
#endif // __REVISION_SQL_H__ #endif // __REVISION_SQL_H__