Merge remote-tracking branch 'remotes/origin/master' into logging_changes

Conflicts:
	world/client.cpp
	world/worlddb.cpp
	zone/aggro.cpp
	zone/bot.cpp
	zone/client.cpp
	zone/client_packet.cpp
	zone/client_process.cpp
	zone/doors.cpp
	zone/entity.cpp
	zone/inventory.cpp
	zone/mob_ai.cpp
	zone/perl_client.cpp
	zone/spells.cpp
	zone/waypoints.cpp
	zone/zone.cpp
	zone/zonedb.cpp
	zone/zoning.cpp
This commit is contained in:
Akkadius
2015-01-21 17:29:30 -06:00
109 changed files with 2543 additions and 2939 deletions
+44 -49
View File
@@ -201,11 +201,11 @@ void QuestManager::write(const char *file, const char *str) {
fclose (pFile);
}
Mob* QuestManager::spawn2(int npc_type, int grid, int unused, float x, float y, float z, float heading) {
Mob* QuestManager::spawn2(int npc_type, int grid, int unused, const xyz_heading& position) {
const NPCType* tmp = 0;
if (tmp = database.GetNPCType(npc_type))
{
NPC* npc = new NPC(tmp, 0, x, y, z, heading, FlyMode3);
NPC* npc = new NPC(tmp, nullptr, position, FlyMode3);
npc->AddLootTable();
entity_list.AddNPC(npc,true,true);
if(grid > 0)
@@ -218,7 +218,7 @@ Mob* QuestManager::spawn2(int npc_type, int grid, int unused, float x, float y,
return nullptr;
}
Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, float x, float y, float z, float heading) {
Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, const xyz_heading& position) {
Mob *other = entity_list.GetMobByNpcTypeID(npc_type);
if(other != nullptr) {
return other;
@@ -227,7 +227,7 @@ Mob* QuestManager::unique_spawn(int npc_type, int grid, int unused, float x, flo
const NPCType* tmp = 0;
if (tmp = database.GetNPCType(npc_type))
{
NPC* npc = new NPC(tmp, 0, x, y, z, heading, FlyMode3);
NPC* npc = new NPC(tmp, nullptr, position, FlyMode3);
npc->AddLootTable();
entity_list.AddNPC(npc,true,true);
if(grid > 0)
@@ -300,8 +300,8 @@ Mob* QuestManager::spawn_from_spawn2(uint32 spawn2_id)
database.UpdateSpawn2Timeleft(spawn2_id, zone->GetInstanceID(), 0);
found_spawn->SetCurrentNPCID(npcid);
NPC* npc = new NPC(tmp, found_spawn, found_spawn->GetX(), found_spawn->GetY(), found_spawn->GetZ(),
found_spawn->GetHeading(), FlyMode3);
auto position = xyz_heading(found_spawn->GetX(), found_spawn->GetY(), found_spawn->GetZ(), found_spawn->GetHeading());
NPC* npc = new NPC(tmp, found_spawn, position, FlyMode3);
found_spawn->SetNPCPointer(npc);
npc->AddLootTable();
@@ -923,7 +923,7 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
spells[curspell].skill != 52 &&
( !RuleB(Spells, UseCHAScribeHack) || spells[curspell].effectid[EFFECT_COUNT - 1] != 10 )
)
{
{
if(IsDiscipline(curspell)){
//we may want to come up with a function like Client::GetNextAvailableSpellBookSlot() to help speed this up a little
for(uint32 r = 0; r < MAX_PP_DISCIPLINES; r++) {
@@ -937,12 +937,12 @@ uint16 QuestManager::traindiscs(uint8 max_level, uint8 min_level) {
SpellGlobalCheckResult = initiator->SpellGlobalCheck(curspell, Char_ID);
if (SpellGlobalCheckResult) {
initiator->GetPP().disciplines.values[r] = curspell;
database.SaveCharacterDisc(Char_ID, r, curspell);
database.SaveCharacterDisc(Char_ID, r, curspell);
initiator->SendDisciplineUpdate();
initiator->Message(0, "You have learned a new discipline!");
count++; //success counter
}
break; //continue the 1st loop
break; //continue the 1st loop
}
else {
initiator->GetPP().disciplines.values[r] = curspell;
@@ -1486,10 +1486,10 @@ void QuestManager::ding() {
}
void QuestManager::rebind(int zoneid, float x, float y, float z) {
void QuestManager::rebind(int zoneid, const xyz_location& location) {
QuestManagerCurrentQuestVars();
if(initiator && initiator->IsClient()) {
initiator->SetBindPoint(zoneid, x, y, z);
initiator->SetBindPoint(zoneid, 0, location);
}
}
@@ -1517,12 +1517,12 @@ void QuestManager::pause(int duration) {
owner->CastToNPC()->PauseWandering(duration);
}
void QuestManager::moveto(float x, float y, float z, float h, bool saveguardspot) {
void QuestManager::moveto(const xyz_heading& position, bool saveguardspot) {
QuestManagerCurrentQuestVars();
if (!owner || !owner->IsNPC())
return;
owner->CastToNPC()->MoveTo(x, y, z, h, saveguardspot);
owner->CastToNPC()->MoveTo(position, saveguardspot);
}
void QuestManager::resume() {
@@ -1563,26 +1563,20 @@ void QuestManager::setnextinchpevent(int at) {
owner->SetNextIncHPEvent(at);
}
void QuestManager::respawn(int npc_type, int grid) {
void QuestManager::respawn(int npcTypeID, int grid) {
QuestManagerCurrentQuestVars();
if (!owner || !owner->IsNPC())
return;
float x,y,z,h;
x = owner->GetX();
y = owner->GetY();
z = owner->GetZ();
h = owner->GetHeading();
running_quest e = quests_running_.top();
e.depop_npc = true;
quests_running_.pop();
quests_running_.push(e);
const NPCType* tmp = 0;
if ((tmp = database.GetNPCType(npc_type)))
const NPCType* npcType = nullptr;
if ((npcType = database.GetNPCType(npcTypeID)))
{
owner = new NPC(tmp, 0, x, y, z, h, FlyMode3);
owner = new NPC(npcType, nullptr, owner->GetPosition(), FlyMode3);
owner->CastToNPC()->AddLootTable();
entity_list.AddNPC(owner->CastToNPC(),true,true);
if(grid > 0)
@@ -1704,27 +1698,28 @@ void QuestManager::sethp(int hpperc) {
owner->Damage(owner, newhp, SPELL_UNKNOWN, SkillHandtoHand, false, 0, false);
}
bool QuestManager::summonburriedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading) {
bool QuestManager::summonburriedplayercorpse(uint32 char_id, const xyz_heading& position) {
bool Result = false;
if(char_id > 0) {
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(char_id, zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading);
if(PlayerCorpse) {
Result = true;
}
}
return Result;
if(char_id <= 0)
return false;
Corpse* PlayerCorpse = database.SummonBuriedCharacterCorpses(char_id, zone->GetZoneID(), zone->GetInstanceID(), position);
if(!PlayerCorpse)
return false;
return true;
}
bool QuestManager::summonallplayercorpses(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading) {
bool Result = false;
bool QuestManager::summonallplayercorpses(uint32 char_id, const xyz_heading& position) {
if(char_id > 0) {
Client* c = entity_list.GetClientByCharID(char_id);
c->SummonAllCorpses(dest_x, dest_y, dest_z, dest_heading);
Result = true;
}
return Result;
if(char_id <= 0)
return false;
Client* c = entity_list.GetClientByCharID(char_id);
c->SummonAllCorpses(position);
return true;
}
uint32 QuestManager::getplayerburriedcorpsecount(uint32 char_id) {
@@ -2312,17 +2307,17 @@ int QuestManager::getlevel(uint8 type)
return 0;
}
uint16 QuestManager::CreateGroundObject(uint32 itemid, float x, float y, float z, float heading, uint32 decay_time)
uint16 QuestManager::CreateGroundObject(uint32 itemid, const xyz_heading& position, uint32 decay_time)
{
uint16 entid = 0; //safety check
entid = entity_list.CreateGroundObject(itemid, x, y, z, heading, decay_time);
entid = entity_list.CreateGroundObject(itemid, position, decay_time);
return entid;
}
uint16 QuestManager::CreateGroundObjectFromModel(const char *model, float x, float y, float z, float heading, uint8 type, uint32 decay_time)
uint16 QuestManager::CreateGroundObjectFromModel(const char *model, const xyz_heading& position, uint8 type, uint32 decay_time)
{
uint16 entid = 0; //safety check
entid = entity_list.CreateGroundObjectFromModel(model, x, y, z, heading, type, decay_time);
entid = entity_list.CreateGroundObjectFromModel(model, position, type, decay_time);
return entid;
}
@@ -2587,12 +2582,12 @@ void QuestManager::RemoveAllFromInstance(uint16 instance_id)
}
}
void QuestManager::MovePCInstance(int zone_id, int instance_id, float x, float y, float z, float heading)
void QuestManager::MovePCInstance(int zone_id, int instance_id, const xyz_heading& position)
{
QuestManagerCurrentQuestVars();
if(initiator)
{
initiator->MovePC(zone_id, instance_id, x, y, z, heading);
initiator->MovePC(zone_id, instance_id, position.m_X, position.m_Y, position.m_Z, position.m_Heading);
}
}
@@ -2841,7 +2836,7 @@ void QuestManager::SendMail(const char *to, const char *from, const char *subjec
uint16 QuestManager::CreateDoor(const char* model, float x, float y, float z, float heading, uint8 opentype, uint16 size)
{
uint16 entid = 0; //safety check
entid = entity_list.CreateDoor(model, x, y, z, heading, opentype, size);
entid = entity_list.CreateDoor(model, xyz_heading(x, y, z, heading), opentype, size);
return entid;
}
@@ -2884,7 +2879,7 @@ void QuestManager::CrossZoneSignalPlayerByName(const char *CharName, uint32 data
CZSC->data = data;
worldserver.SendPacket(pack);
safe_delete(pack);
}
}
void QuestManager::CrossZoneMessagePlayerByName(uint32 Type, const char *CharName, const char *Message){
uint32 message_len = strlen(CharName) + 1;
@@ -2894,7 +2889,7 @@ void QuestManager::CrossZoneMessagePlayerByName(uint32 Type, const char *CharNam
CZSC->Type = Type;
strn0cpy(CZSC->CharName, CharName, 64);
strn0cpy(CZSC->Message, Message, 512);
worldserver.SendPacket(pack);
worldserver.SendPacket(pack);
safe_delete(pack);
}
@@ -2904,7 +2899,7 @@ void QuestManager::CrossZoneSetEntityVariableByNPCTypeID(uint32 npctype_id, cons
ServerPacket* pack = new ServerPacket(ServerOP_CZSetEntityVariableByNPCTypeID, sizeof(CZSetEntVarByNPCTypeID_Struct) + message_len + message_len2);
CZSetEntVarByNPCTypeID_Struct* CZSNBYNID = (CZSetEntVarByNPCTypeID_Struct*)pack->pBuffer;
CZSNBYNID->npctype_id = npctype_id;
strn0cpy(CZSNBYNID->id, id, 256);
strn0cpy(CZSNBYNID->id, id, 256);
strn0cpy(CZSNBYNID->m_var, m_var, 256);
worldserver.SendPacket(pack);
safe_delete(pack);