From 6e5e450054f642fc9ced13975375776beaebb71a Mon Sep 17 00:00:00 2001 From: Kinglykrab Date: Wed, 11 Jun 2014 07:36:14 -0400 Subject: [PATCH] A lot of corpse changes. --- common/database.cpp | 2 +- common/emu_oplist.h | 6 +- common/eq_packet_structs.h | 2 +- common/logtypes.h | 2 +- common/opcode_dispatch.h | 4 +- common/opcode_map.cpp | 6 +- common/patches/Client62_structs.h | 2 +- common/patches/RoF.cpp | 8 +- common/patches/RoF_ops.h | 4 +- common/patches/RoF_structs.h | 2 +- common/patches/SoD_structs.h | 2 +- common/patches/SoF_structs.h | 2 +- common/patches/Titanium_structs.h | 2 +- common/patches/Underfoot_structs.h | 2 +- common/ruletypes.h | 1 + common/servertalk.h | 12 +- common/shareddb.cpp | 2 +- world/zoneserver.cpp | 12 +- zone/StringIDs.h | 4 +- zone/attack.cpp | 12 +- zone/client.cpp | 44 +- zone/client.h | 37 +- zone/client_mods.cpp | 1105 ++++++++-------------------- zone/client_packet.cpp | 72 +- zone/client_packet.h | 2 +- zone/client_process.cpp | 66 +- zone/command.cpp | 46 +- zone/command.h | 4 +- zone/common.h | 4 +- zone/corpse.cpp | 601 ++++++++------- zone/corpse.h | 156 ++-- zone/embparser_api.cpp | 20 +- zone/entity.cpp | 18 +- zone/entity.h | 2 +- zone/exp.cpp | 8 +- zone/lua_corpse.cpp | 30 +- zone/lua_general.cpp | 12 +- zone/merc.cpp | 2 +- zone/mob.cpp | 2 +- zone/perl_PlayerCorpse.cpp | 248 ++++--- zone/questmgr.cpp | 8 +- zone/questmgr.h | 4 +- zone/spell_effects.cpp | 6 +- zone/spells.cpp | 40 +- zone/worldserver.cpp | 76 +- zone/worldserver.h | 2 +- zone/zonedb.h | 8 +- 47 files changed, 1140 insertions(+), 1572 deletions(-) diff --git a/common/database.cpp b/common/database.cpp index 5138411c7..2cd52c2cf 100644 --- a/common/database.cpp +++ b/common/database.cpp @@ -2700,7 +2700,7 @@ void Database::BuryCorpsesInInstance(uint16 instance_id) char *query = 0; MYSQL_RES *result; - if(RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET IsBurried=1, instanceid=0 WHERE instanceid=%u", + if(RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET Isburied=1, instanceid=0 WHERE instanceid=%u", instance_id), errbuf, &result)) { mysql_free_result(result); diff --git a/common/emu_oplist.h b/common/emu_oplist.h index 6a62a4297..957460e87 100644 --- a/common/emu_oplist.h +++ b/common/emu_oplist.h @@ -100,8 +100,8 @@ N(OP_Track), N(OP_ItemLinkClick), N(OP_ItemLinkResponse), N(OP_ItemLinkText), -N(OP_RezzAnswer), -N(OP_RezzComplete), +N(OP_ResurrectionAnswer), +N(OP_ResurrectionComplete), N(OP_SendZonepoints), N(OP_SetRunMode), N(OP_InspectRequest), @@ -281,7 +281,7 @@ N(OP_LoginComplete), N(OP_GMNameChange), N(OP_ReadBook), N(OP_GMKick), -N(OP_RezzRequest), +N(OP_ResurrectionRequest), N(OP_MultiLineMsg), N(OP_TimeOfDay), N(OP_CompletedTasks), diff --git a/common/eq_packet_structs.h b/common/eq_packet_structs.h index 674ed15b7..36361c279 100644 --- a/common/eq_packet_structs.h +++ b/common/eq_packet_structs.h @@ -2571,7 +2571,7 @@ struct Resurrect_Struct { /*020*/ uint32 unknown020; /*024*/ char your_name[64]; /*088*/ uint32 unknown088; -/*092*/ char rezzer_name[64]; +/*092*/ char resurrecter_name[64]; /*156*/ uint32 spellid; /*160*/ char corpse_name[64]; /*224*/ uint32 action; diff --git a/common/logtypes.h b/common/logtypes.h index cadfbf71a..b80adbc3c 100644 --- a/common/logtypes.h +++ b/common/logtypes.h @@ -95,7 +95,7 @@ LOG_TYPE( SPELLS, BUFFS, DISABLED ) LOG_TYPE( SPELLS, PROCS, DISABLED ) LOG_TYPE( SPELLS, MODIFIERS, DISABLED ) LOG_TYPE( SPELLS, CRITS, DISABLED ) -LOG_TYPE( SPELLS, REZ, DISABLED ) +LOG_TYPE( SPELLS, RESURRECTION, DISABLED ) LOG_CATEGORY( FACTION ) diff --git a/common/opcode_dispatch.h b/common/opcode_dispatch.h index 352fc62ef..4f1e0f13c 100644 --- a/common/opcode_dispatch.h +++ b/common/opcode_dispatch.h @@ -162,7 +162,7 @@ IN(OP_DeleteItem, DeleteItem_Struct); IN(OP_CombatAbility, CombatAbility_Struct); IN(OP_Taunt, ClientTarget_Struct); INz(OP_InstillDoubt); -IN(OP_RezzAnswer, Resurrect_Struct); +IN(OP_ResurrectionAnswer, Resurrect_Struct); IN(OP_GMSummon, GMSummon_Struct); IN(OP_TradeBusy, TradeBusy_Struct); IN(OP_TradeRequest, TradeRequest_Struct); @@ -376,7 +376,7 @@ OUT(OP_RandomReply, RandomReply_Struct); OUT(OP_RecipeReply, RecipeReply_Struct); OUT(OP_RequestClientZoneChange, RequestClientZoneChange_Struct); OUT(OP_RespondAA, AATable_Struct); -OUT(OP_RezzRequest, Resurrect_Struct); +OUT(OP_ResurrectionRequest, Resurrect_Struct); OUT(OP_SetTitleReply, SetTitleReply_Struct); OUT(OP_ShopDelItem, Merchant_DelItem_Struct); OUT(OP_SimpleMessage, SimpleMessage_Struct); diff --git a/common/opcode_map.cpp b/common/opcode_map.cpp index 10babaccb..e49e1fe14 100644 --- a/common/opcode_map.cpp +++ b/common/opcode_map.cpp @@ -119,9 +119,9 @@ void load_opcode_names() opcode_map[0x001f]="LiveOP_ItemLinkClick"; opcode_map[0x01f4]="LiveOP_ItemLinkResponse"; opcode_map[0x01d9]="LiveOP_ItemLinkText"; - opcode_map[0x0a41]="LiveOP_RezzRequest"; - opcode_map[0x00e5]="LiveOP_RezzAnswer"; - opcode_map[0x019b]="LiveOP_RezzComplete"; + opcode_map[0x0a41]="LiveOP_ResurrectionRequest"; + opcode_map[0x00e5]="LiveOP_ResurrectionAnswer"; + opcode_map[0x019b]="LiveOP_ResurrectionComplete"; opcode_map[0x0128]="LiveOP_MoveDoor"; opcode_map[0x0127]="LiveOP_ClickDoor"; opcode_map[0x0247]="LiveOP_SendZonepoints"; diff --git a/common/patches/Client62_structs.h b/common/patches/Client62_structs.h index 27b808620..7122f6e32 100644 --- a/common/patches/Client62_structs.h +++ b/common/patches/Client62_structs.h @@ -2043,7 +2043,7 @@ struct Resurrect_Struct { float z; char your_name[64]; uint32 unknown88; - char rezzer_name[64]; + char resurrecter_name[64]; uint32 spellid; char corpse_name[64]; uint32 action; diff --git a/common/patches/RoF.cpp b/common/patches/RoF.cpp index cbe228c92..9456e0956 100644 --- a/common/patches/RoF.cpp +++ b/common/patches/RoF.cpp @@ -4003,7 +4003,7 @@ ENCODE(OP_BeginCast) FINISH_ENCODE(); } -ENCODE(OP_RezzRequest) +ENCODE(OP_ResurrectionRequest) { SETUP_DIRECT_ENCODE(Resurrect_Struct, structs::Resurrect_Struct); @@ -4013,7 +4013,7 @@ ENCODE(OP_RezzRequest) OUT(x); OUT(z); OUT_str(your_name); - OUT_str(rezzer_name); + OUT_str(resurrecter_name); OUT(spellid); OUT_str(corpse_name); OUT(action); @@ -4817,7 +4817,7 @@ DECODE(OP_GuildStatus) FINISH_DIRECT_DECODE(); } -DECODE(OP_RezzAnswer) +DECODE(OP_ResurrectionAnswer) { DECODE_LENGTH_EXACT(structs::Resurrect_Struct); SETUP_DIRECT_DECODE(Resurrect_Struct, structs::Resurrect_Struct); @@ -4828,7 +4828,7 @@ DECODE(OP_RezzAnswer) IN(x); IN(z); memcpy(emu->your_name, eq->your_name, sizeof(emu->your_name)); - memcpy(emu->rezzer_name, eq->rezzer_name, sizeof(emu->rezzer_name)); + memcpy(emu->resurrecter_name, eq->resurrecter_name, sizeof(emu->resurrecter_name)); IN(spellid); memcpy(emu->corpse_name, eq->corpse_name, sizeof(emu->corpse_name)); IN(action); diff --git a/common/patches/RoF_ops.h b/common/patches/RoF_ops.h index 9e3a91c7e..a73df451a 100644 --- a/common/patches/RoF_ops.h +++ b/common/patches/RoF_ops.h @@ -100,7 +100,7 @@ E(OP_MercenaryDataResponse) E(OP_GuildMemberUpdate) E(OP_GMLastName) E(OP_BeginCast) -E(OP_RezzRequest) +E(OP_ResurrectionRequest) //list of packets we need to decode on the way in: D(OP_SetServerFilter) D(OP_CharacterCreate) @@ -157,6 +157,6 @@ D(OP_GuildRemove) D(OP_GuildStatus) D(OP_Trader) D(OP_GMLastName) -D(OP_RezzAnswer) +D(OP_ResurrectionAnswer) #undef E #undef D diff --git a/common/patches/RoF_structs.h b/common/patches/RoF_structs.h index 918bbe68d..6e1ec9980 100644 --- a/common/patches/RoF_structs.h +++ b/common/patches/RoF_structs.h @@ -2807,7 +2807,7 @@ struct Resurrect_Struct /*020*/ uint32 unknown020; /*024*/ char your_name[64]; /*088*/ uint32 unknown088; -/*092*/ char rezzer_name[64]; +/*092*/ char resurrecter_name[64]; /*156*/ uint32 spellid; /*160*/ char corpse_name[64]; /*224*/ uint32 action; diff --git a/common/patches/SoD_structs.h b/common/patches/SoD_structs.h index 99a904b86..fcb54a2ea 100644 --- a/common/patches/SoD_structs.h +++ b/common/patches/SoD_structs.h @@ -2461,7 +2461,7 @@ struct Resurrect_Struct { float z; char your_name[64]; uint32 unknown88; - char rezzer_name[64]; + char resurrecter_name[64]; uint32 spellid; char corpse_name[64]; uint32 action; diff --git a/common/patches/SoF_structs.h b/common/patches/SoF_structs.h index a31d60ef8..d062c193c 100644 --- a/common/patches/SoF_structs.h +++ b/common/patches/SoF_structs.h @@ -2395,7 +2395,7 @@ struct Resurrect_Struct { float z; char your_name[64]; uint32 unknown88; - char rezzer_name[64]; + char resurrecter_name[64]; uint32 spellid; char corpse_name[64]; uint32 action; diff --git a/common/patches/Titanium_structs.h b/common/patches/Titanium_structs.h index 1c058fb77..65db3a611 100644 --- a/common/patches/Titanium_structs.h +++ b/common/patches/Titanium_structs.h @@ -2090,7 +2090,7 @@ struct Resurrect_Struct { float z; char your_name[64]; uint32 unknown88; - char rezzer_name[64]; + char resurrecter_name[64]; uint32 spellid; char corpse_name[64]; uint32 action; diff --git a/common/patches/Underfoot_structs.h b/common/patches/Underfoot_structs.h index ee7286dab..074605da5 100644 --- a/common/patches/Underfoot_structs.h +++ b/common/patches/Underfoot_structs.h @@ -2500,7 +2500,7 @@ struct Resurrect_Struct { float z; char your_name[64]; uint32 unknown88; - char rezzer_name[64]; + char resurrecter_name[64]; uint32 spellid; char corpse_name[64]; uint32 action; diff --git a/common/ruletypes.h b/common/ruletypes.h index c585fbbd2..a92b9fe11 100644 --- a/common/ruletypes.h +++ b/common/ruletypes.h @@ -313,6 +313,7 @@ RULE_BOOL ( Spells, FocusCombatProcs, false) //Allow all combat procs to receive RULE_CATEGORY_END() RULE_CATEGORY( Combat ) +RULE_INT ( Combat, AvoidanceCap, 1000 ) // The avoidance cap. RULE_INT ( Combat, MeleeBaseCritChance, 0 ) //The base crit chance for non warriors, NOTE: This will apply to NPCs as well RULE_INT ( Combat, WarBerBaseCritChance, 3 ) //The base crit chance for warriors and berserkers, only applies to clients RULE_INT ( Combat, BerserkBaseCritChance, 6 ) //The bonus base crit chance you get when you're berserk diff --git a/common/servertalk.h b/common/servertalk.h index d5d7c3604..cd08462ad 100644 --- a/common/servertalk.h +++ b/common/servertalk.h @@ -45,7 +45,7 @@ #define ServerOP_Petition 0x001E #define ServerOP_KillPlayer 0x001F #define ServerOP_UpdateGM 0x0020 -#define ServerOP_RezzPlayer 0x0021 +#define ServerOP_ResurrectPlayer 0x0021 #define ServerOP_ZoneReboot 0x0022 #define ServerOP_ZoneToZoneRequest 0x0023 #define ServerOP_AcceptWorldEntrance 0x0024 @@ -63,11 +63,11 @@ #define ServerOP_GroupIDReq 0x0030 #define ServerOP_GroupIDReply 0x0031 #define ServerOP_GroupLeave 0x0032 // for disbanding out of zone folks -#define ServerOP_RezzPlayerAccept 0x0033 +#define ServerOP_ResurrectPlayerAccept 0x0033 #define ServerOP_SpawnCondition 0x0034 #define ServerOP_SpawnEvent 0x0035 #define ServerOP_SetLaunchName 0x0036 -#define ServerOP_RezzPlayerReject 0x0037 +#define ServerOP_ResurrectPlayerReject 0x0037 #define ServerOP_SpawnPlayerCorpse 0x0038 #define ServerOP_Consent 0x0039 #define ServerOP_Consent_Response 0x003a @@ -412,12 +412,12 @@ struct ServerZonePlayer_Struct { float z_pos; }; -struct RezzPlayer_Struct { +struct ResurrectPlayer_Struct { uint32 dbid; uint32 exp; - uint16 rezzopcode; + uint16 resurrectionopcode; //char packet[160]; - Resurrect_Struct rez; + Resurrect_Struct resurrect; }; struct ServerZoneReboot_Struct { diff --git a/common/shareddb.cpp b/common/shareddb.cpp index 03d6c4c52..84ce78f30 100644 --- a/common/shareddb.cpp +++ b/common/shareddb.cpp @@ -1355,7 +1355,7 @@ int32 SharedDatabase::DeleteStalePlayerCorpses() { if(RuleB(Zone, EnableShadowrest)) { - if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET IsBurried = 1 WHERE IsBurried=0 and " + if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET Isburied = 1 WHERE Isburied=0 and " "(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) > %d and not timeofdeath=0", (RuleI(Character, CorpseDecayTimeMS) / 1000)), errbuf, 0, &affected_rows)) { diff --git a/world/zoneserver.cpp b/world/zoneserver.cpp index 73a4a6c67..997df794a 100644 --- a/world/zoneserver.cpp +++ b/world/zoneserver.cpp @@ -517,22 +517,22 @@ bool ZoneServer::Process() { break; } - case ServerOP_RezzPlayerAccept: { + case ServerOP_ResurrectPlayerAccept: { zoneserver_list.SendPacket(pack); break; } - case ServerOP_RezzPlayer: { + case ServerOP_ResurrectPlayer: { - RezzPlayer_Struct* sRezz = (RezzPlayer_Struct*) pack->pBuffer; + ResurrectPlayer_Struct* sRezz = (ResurrectPlayer_Struct*) pack->pBuffer; if (zoneserver_list.SendPacket(pack)){ - zlog(WORLD__ZONE,"Sent Rez packet for %s",sRezz->rez.your_name); + zlog(WORLD__ZONE,"Sent Resurrection packet for %s",sRezz->resurrect.your_name); } else { - zlog(WORLD__ZONE,"Could not send Rez packet for %s",sRezz->rez.your_name); + zlog(WORLD__ZONE,"Could not send Resurrection packet for %s",sRezz->resurrect.your_name); } break; } - case ServerOP_RezzPlayerReject: + case ServerOP_ResurrectPlayerReject: { char *Recipient = (char *)pack->pBuffer; client_list.SendPacket(Recipient, pack); diff --git a/zone/StringIDs.h b/zone/StringIDs.h index 9a222d276..36fb3d08c 100644 --- a/zone/StringIDs.h +++ b/zone/StringIDs.h @@ -91,7 +91,7 @@ #define MISSING_SPELL_COMP 272 //You are missing some required spell components. #define INVIS_BEGIN_BREAK 275 //You feel yourself starting to appear. #define DISCIPLINE_CONLOST 278 //You lose the concentration to remain in your fighting discipline. -#define REZ_REGAIN 289 //You regain some experience from resurrection. +#define RESURRECTION_REGAIN 289 //You regain some experience from resurrection. #define DUP_LORE 290 //Duplicate lore items are not allowed. #define TGB_ON 293 //Target other group buff is *ON*. #define TGB_OFF 294 //Target other group buff is *OFF*. @@ -216,7 +216,7 @@ #define DUEL_ACCEPTED 1384 //%1 has already accepted a duel with someone else. #define DUEL_CONSIDERING 1385 //%1 is considering a duel with someone else. #define PLAYER_REGAIN 1394 //You have control of yourself again. -#define REZZ_ALREADY_PENDING 1379 //You were unable to restore the corpse to life, but you may have success with a later attempt. +#define RESURRECTION_ALREADY_PENDING 1379 //You were unable to restore the corpse to life, but you may have success with a later attempt. #define IN_USE 1406 //Someone else is using that. Try again later. #define DUEL_FLED 1408 //%1 has defeated %2 in a duel to the death! %3 has fled like a cowardly dog! #define MEMBER_OF_YOUR_GUILD 1429 diff --git a/zone/attack.cpp b/zone/attack.cpp index ff9b1f965..d969139ba 100644 --- a/zone/attack.cpp +++ b/zone/attack.cpp @@ -1647,14 +1647,14 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att database.GetVariable("PvPitem", tmp2, 9); int pvpitem = atoi(tmp2); if(pvpitem>0 && pvpitem<200000) - new_corpse->SetPKItem(pvpitem); + new_corpse->setPKItem(pvpitem); } else if(reward==2) - new_corpse->SetPKItem(-1); + new_corpse->setPKItem(-1); else if(reward==1) - new_corpse->SetPKItem(1); + new_corpse->setPKItem(1); else - new_corpse->SetPKItem(0); + new_corpse->setPKItem(0); if(killerMob->CastToClient()->isgrouped) { Group* group = entity_list.GetGroupByClient(killerMob->CastToClient()); if(group != 0) @@ -1663,7 +1663,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att { if(group->members[i] != nullptr) { - new_corpse->AllowMobLoot(group->members[i],i); + new_corpse->AllowMobLoot(group->members[i], i); } } } @@ -2336,7 +2336,7 @@ bool NPC::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes attack if(group != 0) { for(int i=0;i<6;i++) { // Doesnt work right, needs work if(group->members[i] != nullptr) { - corpse->AllowMobLoot(group->members[i],i); + corpse->AllowMobLoot(group->members[i], i); } } } diff --git a/zone/client.cpp b/zone/client.cpp index 1509fe233..c2b450104 100644 --- a/zone/client.cpp +++ b/zone/client.cpp @@ -232,9 +232,9 @@ Client::Client(EQStreamInterface* ieqs) // initialise haste variable m_tradeskill_object = nullptr; delaytimer = false; - PendingRezzXP = -1; - PendingRezzDBID = 0; - PendingRezzSpellID = 0; + PendingResurrectionXP = -1; + PendingResurrectionDBID = 0; + PendingResurrectionSpellID = 0; numclients++; // emuerror; UpdateWindowTitle(); @@ -2598,12 +2598,12 @@ void Client::LogLoot(Client* player, Corpse* corpse, const Item_Struct* item){ database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Looting Item",logtext,4); } else{ - if ((corpse->GetPlatinum() + corpse->GetGold() + corpse->GetSilver() + corpse->GetCopper())>0) { + if ((corpse->getPlatinum() + corpse->getGold() + corpse->getSilver() + corpse->getCopper())>0) { memset(coinloot,0,sizeof(coinloot)); - sprintf(coinloot,"%i PP %i GP %i SP %i CP",corpse->GetPlatinum(),corpse->GetGold(),corpse->GetSilver(),corpse->GetCopper()); + sprintf(coinloot,"%i PP %i GP %i SP %i CP",corpse->getPlatinum(),corpse->getGold(),corpse->getSilver(),corpse->getCopper()); logtext=coinloot; strcat(logtext," Looted"); - if (corpse->GetPlatinum()>10000) + if (corpse->getPlatinum()>10000) database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Excessive Loot!",logtext,9); else database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Looting Money",logtext,5); @@ -4434,7 +4434,7 @@ void Client::SendRespawnBinds() // Client will respond with a 4 byte packet that includes the number of the selection made // - //If no options have been given, default to Bind + Rez + //If no options have been given, default to Bind + Resurrect if (respawn_options.empty()) { BindStruct* b = &m_pp.binds[0]; @@ -4447,15 +4447,15 @@ void Client::SendRespawnBinds() opt.heading = b->heading; respawn_options.push_front(opt); } - //Rez is always added at the end - RespawnOption rez; - rez.name = "Resurrect"; - rez.zoneid = zone->GetZoneID(); - rez.x = GetX(); - rez.y = GetY(); - rez.z = GetZ(); - rez.heading = GetHeading(); - respawn_options.push_back(rez); + //Resurrection is always added at the end + RespawnOption resurrect; + resurrect.name = "Resurrect"; + resurrect.zoneid = zone->GetZoneID(); + resurrect.x = GetX(); + resurrect.y = GetY(); + resurrect.z = GetZ(); + resurrect.heading = GetHeading(); + respawn_options.push_back(resurrect); int num_options = respawn_options.size(); uint32 PacketLength = 17 + (26 * num_options); //Header size + per-option invariant size @@ -4491,7 +4491,7 @@ void Client::SendRespawnBinds() VARSTRUCT_ENCODE_TYPE(float, buffer, opt->z); VARSTRUCT_ENCODE_TYPE(float, buffer, opt->heading); VARSTRUCT_ENCODE_STRING(buffer, opt->name.c_str()); - VARSTRUCT_ENCODE_TYPE(uint8, buffer, (count == num_options)); //is this one Rez (the last option)? + VARSTRUCT_ENCODE_TYPE(uint8, buffer, (count == num_options)); //is this one Resurrection (the last option)? } QueuePacket(outapp); @@ -4730,9 +4730,9 @@ int Client::LDoNChest_SkillCheck(NPC *target, int skill) return 0; } -void Client::SummonAndRezzAllCorpses() +void Client::SummonAndResurrectAllCorpses() { - PendingRezzXP = -1; + PendingResurrectionXP = -1; ServerPacket *Pack = new ServerPacket(ServerOP_DepopAllPlayersCorpses, sizeof(ServerDepopAllPlayersCorpses_Struct)); @@ -4756,10 +4756,10 @@ void Client::SummonAndRezzAllCorpses() return; } - int RezzExp = entity_list.RezzAllCorpsesByCharID(CharacterID()); + int ResurrectionExp = entity_list.ResurrectAllCorpsesByCharID(CharacterID()); - if(RezzExp > 0) - SetEXP(GetEXP() + RezzExp, GetAAXP(), true); + if(ResurrectionExp > 0) + SetEXP(GetEXP() + ResurrectionExp, GetAAXP(), true); Message(clientMessageYellow, "All your corpses have been summoned to your feet and have received a 100% resurrection."); } diff --git a/zone/client.h b/zone/client.h index 0c7da944a..8d8e4c073 100644 --- a/zone/client.h +++ b/zone/client.h @@ -214,8 +214,7 @@ public: //abstract virtual function implementations requird by base abstract class virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill); virtual void Damage(Mob* from, int32 damage, uint16 spell_id, SkillUseTypes attack_skill, bool avoidable = true, int8 buffslot = -1, bool iBuffTic = false); - virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, - ExtraAttackOptions *opts = nullptr); + virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr); virtual bool HasRaid() { return (GetRaid() ? true : false); } virtual bool HasGroup() { return (GetGroup() ? true : false); } virtual Raid* GetRaid() { return entity_list.GetRaidByClient(this); } @@ -252,12 +251,7 @@ public: void Message_StringID(uint32 type, uint32 string_id, const char* message,const char* message2=0,const char* message3=0,const char* message4=0,const char* message5=0,const char* message6=0,const char* message7=0,const char* message8=0,const char* message9=0, uint32 distance = 0); bool FilteredMessageCheck(Mob *sender, eqFilterType filter); void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id); - void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, - uint32 string_id, const char *message1, const char *message2 = nullptr, - const char *message3 = nullptr, const char *message4 = nullptr, - const char *message5 = nullptr, const char *message6 = nullptr, - const char *message7 = nullptr, const char *message8 = nullptr, - const char *message9 = nullptr); + void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, uint32 string_id, const char *message1, const char *message2 = nullptr, const char *message3 = nullptr, const char *message4 = nullptr, const char *message5 = nullptr, const char *message6 = nullptr, const char *message7 = nullptr, const char *message8 = nullptr, const char *message9 = nullptr); void SendBazaarResults(uint32 trader_id,uint32 class_,uint32 race,uint32 stat,uint32 slot,uint32 type,char name[64],uint32 minprice,uint32 maxprice); void SendTraderItem(uint32 item_id,uint16 quantity); uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity); @@ -780,8 +774,7 @@ public: int16 acmod(); // Item methods - uint32 NukeItem(uint32 itemnum, uint8 where_to_check = - (invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor)); + uint32 NukeItem(uint32 itemnum, uint8 where_to_check = (invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor)); void SetTint(int16 slot_id, uint32 color); void SetTint(int16 slot_id, Color_Struct& color); void SetMaterial(int16 slot_id, uint32 item_id); @@ -1043,7 +1036,7 @@ public: bool CalcItemScale(uint32 slot_x, uint32 slot_y); void DoItemEnterZone(); bool DoItemEnterZone(uint32 slot_x, uint32 slot_y); - void SummonAndRezzAllCorpses(); + void SummonAndResurrectAllCorpses(); void SummonAllCorpses(float dest_x, float dest_y, float dest_z, float dest_heading); void DepopAllCorpses(); void DepopPlayerCorpse(uint32 dbid); @@ -1083,8 +1076,8 @@ public: bool RemoveRespawnOption(std::string option_name); bool RemoveRespawnOption(uint8 position); void ClearRespawnOptions() { respawn_options.clear(); } - void SetPendingRezzData(int XP, uint32 DBID, uint16 SpellID, const char *CorpseName) { PendingRezzXP = XP; PendingRezzDBID = DBID; PendingRezzSpellID = SpellID; PendingRezzCorpseName = CorpseName; } - bool IsRezzPending() { return PendingRezzSpellID > 0; } + void SetPendingResurrectionData(int XP, uint32 DBID, uint16 SpellID, const char *CorpseName) { PendingResurrectionXP = XP; PendingResurrectionDBID = DBID; PendingResurrectionSpellID = SpellID; PendingResurrectionCorpseName = CorpseName; } + bool IsResurrectionPending() { return PendingResurrectionSpellID > 0; } void ClearHover(); inline bool IsBlockedBuff(int16 SpellID) { return PlayerBlockedBuffs.find(SpellID) != PlayerBlockedBuffs.end(); } inline bool IsBlockedPetBuff(int16 SpellID) { return PetBlockedBuffs.find(SpellID) != PetBlockedBuffs.end(); } @@ -1168,7 +1161,8 @@ public: int16 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); } void LoadAccountFlags(); void SetAccountFlag(std::string flag, std::string val); - std::string GetAccountFlag(std::string flag); float GetDamageMultiplier(SkillUseTypes); + std::string GetAccountFlag(std::string flag); + float GetDamageMultiplier(SkillUseTypes); void Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_consume); void PlayMP3(const char* fname); void ExpeditionSay(const char *str, int ExpID); @@ -1236,7 +1230,7 @@ private: eqFilterMode ClientFilters[_FilterCount]; int32 HandlePacket(const EQApplicationPacket *app); void OPTGB(const EQApplicationPacket *app); - void OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z); + void OPResurrectionAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z); void OPMemorizeSpell(const EQApplicationPacket *app); void OPMoveCoin(const EQApplicationPacket* app); void MoveItemCharges(ItemInst &from, int16 to_slot, uint8 type); @@ -1253,7 +1247,7 @@ private: void HandleTraderPriceUpdate(const EQApplicationPacket *app); - int16 CalcAC(); + int32 CalcAC(); int16 GetACMit(); int16 GetACAvoid(); int16 CalcATK(); @@ -1485,10 +1479,10 @@ private: uint8 HideCorpseMode; bool PendingGuildInvitation; - int PendingRezzXP; - uint32 PendingRezzDBID; - uint16 PendingRezzSpellID; // Only used for resurrect while hovering. - std::string PendingRezzCorpseName; // Only used for resurrect while hovering. + int PendingResurrectionXP; + uint32 PendingResurrectionDBID; + uint16 PendingResurrectionSpellID; // Only used for resurrect while hovering. + std::string PendingResurrectionCorpseName; // Only used for resurrect while hovering. std::set PlayerBlockedBuffs; std::set PetBlockedBuffs; @@ -1506,5 +1500,4 @@ private: uint8 initial_respawn_selection; }; -#endif - +#endif \ No newline at end of file diff --git a/zone/client_mods.cpp b/zone/client_mods.cpp index 955a29d38..8fcd97f92 100644 --- a/zone/client_mods.cpp +++ b/zone/client_mods.cpp @@ -33,125 +33,83 @@ #include "StringIDs.h" #include "NpcAI.h" - -// Return max stat value for level -int16 Client::GetMaxStat() const { - +int16 Client::GetMaxStat() const { // Return max stat value for level if((RuleI(Character, StatCap)) > 0) return (RuleI(Character, StatCap)); - int level = GetLevel(); - int16 base = 0; - - if (level < 61) { + if (level < 61) base = 255; - } - else if (GetClientVersion() >= EQClientSoF) { + else if (GetClientVersion() >= EQClientSoF) base = 255 + 5 * (level - 60); - } - else if (level < 71) { + else if (level < 71) base = 255 + 5 * (level - 60); - } - else { + else base = 330; - } - return(base); } -int16 Client::GetMaxResist() const -{ +int16 Client::GetMaxResist() const { int level = GetLevel(); - int16 base = 500; - if(level > 60) base += ((level - 60) * 5); - return base; } int16 Client::GetMaxSTR() const { - return GetMaxStat() - + itembonuses.STRCapMod - + spellbonuses.STRCapMod - + aabonuses.STRCapMod; + return (GetMaxStat() + itembonuses.STRCapMod + spellbonuses.STRCapMod + aabonuses.STRCapMod); } + int16 Client::GetMaxSTA() const { - return GetMaxStat() - + itembonuses.STACapMod - + spellbonuses.STACapMod - + aabonuses.STACapMod; + return (GetMaxStat() + itembonuses.STACapMod + spellbonuses.STACapMod + aabonuses.STACapMod); } + int16 Client::GetMaxDEX() const { - return GetMaxStat() - + itembonuses.DEXCapMod - + spellbonuses.DEXCapMod - + aabonuses.DEXCapMod; + return (GetMaxStat() + itembonuses.DEXCapMod + spellbonuses.DEXCapMod + aabonuses.DEXCapMod); } + int16 Client::GetMaxAGI() const { - return GetMaxStat() - + itembonuses.AGICapMod - + spellbonuses.AGICapMod - + aabonuses.AGICapMod; + return (GetMaxStat() + itembonuses.AGICapMod + spellbonuses.AGICapMod + aabonuses.AGICapMod); } + int16 Client::GetMaxINT() const { - return GetMaxStat() - + itembonuses.INTCapMod - + spellbonuses.INTCapMod - + aabonuses.INTCapMod; + return (GetMaxStat() + itembonuses.INTCapMod + spellbonuses.INTCapMod + aabonuses.INTCapMod); } + int16 Client::GetMaxWIS() const { - return GetMaxStat() - + itembonuses.WISCapMod - + spellbonuses.WISCapMod - + aabonuses.WISCapMod; + return (GetMaxStat() + itembonuses.WISCapMod + spellbonuses.WISCapMod + aabonuses.WISCapMod); } + int16 Client::GetMaxCHA() const { - return GetMaxStat() - + itembonuses.CHACapMod - + spellbonuses.CHACapMod - + aabonuses.CHACapMod; + return (GetMaxStat() + itembonuses.CHACapMod + spellbonuses.CHACapMod + aabonuses.CHACapMod); } + int16 Client::GetMaxMR() const { - return GetMaxResist() - + itembonuses.MRCapMod - + spellbonuses.MRCapMod - + aabonuses.MRCapMod; + return (GetMaxResist() + itembonuses.MRCapMod + spellbonuses.MRCapMod + aabonuses.MRCapMod); } + int16 Client::GetMaxPR() const { - return GetMaxResist() - + itembonuses.PRCapMod - + spellbonuses.PRCapMod - + aabonuses.PRCapMod; + return (GetMaxResist() + itembonuses.PRCapMod + spellbonuses.PRCapMod + aabonuses.PRCapMod); } + int16 Client::GetMaxDR() const { - return GetMaxResist() - + itembonuses.DRCapMod - + spellbonuses.DRCapMod - + aabonuses.DRCapMod; + return (GetMaxResist() + itembonuses.DRCapMod + spellbonuses.DRCapMod + aabonuses.DRCapMod); } + int16 Client::GetMaxCR() const { - return GetMaxResist() - + itembonuses.CRCapMod - + spellbonuses.CRCapMod - + aabonuses.CRCapMod; + return (GetMaxResist() + itembonuses.CRCapMod + spellbonuses.CRCapMod + aabonuses.CRCapMod); } + int16 Client::GetMaxFR() const { - return GetMaxResist() - + itembonuses.FRCapMod - + spellbonuses.FRCapMod - + aabonuses.FRCapMod; + return (GetMaxResist() + itembonuses.FRCapMod + spellbonuses.FRCapMod + aabonuses.FRCapMod); } + int16 Client::GetMaxCorrup() const { - return GetMaxResist() - + itembonuses.CorrupCapMod - + spellbonuses.CorrupCapMod - + aabonuses.CorrupCapMod; + return (GetMaxResist() + itembonuses.CorrupCapMod + spellbonuses.CorrupCapMod + aabonuses.CorrupCapMod); } -int32 Client::LevelRegen() -{ + +int32 Client::LevelRegen() { bool sitting = IsSitting(); bool feigned = GetFeigned(); int level = GetLevel(); @@ -159,8 +117,7 @@ int32 Client::LevelRegen() uint8 multiplier1 = bonus ? 2 : 1; int32 hp = 0; - //these calculations should match up with the info from Monkly Business, which was last updated ~05/2008: http://www.monkly-business.net/index.php?pageid=abilities - if (level < 51) { + if (level < 51) { //these calculations should match up with the info from Monkly Business, which was last updated ~05/2008: http://www.monkly-business.net/index.php?pageid=abilities if (sitting) { if (level < 20) hp += 2 * multiplier1; @@ -172,8 +129,7 @@ int32 Client::LevelRegen() else //feigned or standing hp += 1 * multiplier1; } - //there may be an easier way to calculate this next part, but I don't know what it is - else { //level >= 51 + else { //there may be an easier way to calculate this next part, but I don't know what it is - level >= 51 int32 tmp = 0; float multiplier2 = 1; if (level < 56) { @@ -206,58 +162,42 @@ int32 Client::LevelRegen() if (bonus) multiplier2 = 2.58; } - hp += int32(float(tmp) * multiplier2); - if (sitting) hp += 3 * multiplier1; else if (feigned) hp += 1 * multiplier1; } - return hp; } int32 Client::CalcHPRegen() { - int32 regen = LevelRegen() + itembonuses.HPRegen + spellbonuses.HPRegen; - - regen += aabonuses.HPRegen + GroupLeadershipAAHealthRegeneration(); - + int32 regen = (LevelRegen() + itembonuses.HPRegen + spellbonuses.HPRegen); + regen += (aabonuses.HPRegen + GroupLeadershipAAHealthRegeneration()); return (regen * RuleI(Character, HPRegenMultiplier) / 100); } -int32 Client::CalcHPRegenCap() -{ - int cap = RuleI(Character, ItemHealthRegenCap) + itembonuses.HeroicSTA/25; - - cap += aabonuses.ItemHPRegenCap + spellbonuses.ItemHPRegenCap + itembonuses.ItemHPRegenCap; - +int32 Client::CalcHPRegenCap() { + int cap = (RuleI(Character, ItemHealthRegenCap) + itembonuses.HeroicSTA / 25); + cap += (aabonuses.ItemHPRegenCap + spellbonuses.ItemHPRegenCap + itembonuses.ItemHPRegenCap); return (cap * RuleI(Character, HPRegenMultiplier) / 100); } int32 Client::CalcMaxHP() { float nd = 10000; max_hp = (CalcBaseHP() + itembonuses.HP); - - //The AA desc clearly says it only applies to base hp.. - //but the actual effect sent on live causes the client - //to apply it to (basehp + itemhp).. I will oblige to the client's whims over - //the aa description - nd += aabonuses.MaxHP; //Natural Durability, Physical Enhancement, Planar Durability - - max_hp = (float)max_hp * (float)nd / (float)10000; //this is to fix the HP-above-495k issue - max_hp += spellbonuses.HP + aabonuses.HP; - + nd += aabonuses.MaxHP; //The AA desc clearly says it only applies to base hp but the actual effect sent on live causes the client to apply it to (basehp + itemhp).. I will oblige to the client's whims over the aa description - Natural Durability, Physical Enhancement, Planar Durability + max_hp = ((float)max_hp * (float)nd / (float)10000); //this is to fix the HP-above-495k issue + max_hp += (spellbonuses.HP + aabonuses.HP); max_hp += GroupLeadershipAAHealthEnhancement(); - - max_hp += max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f); + max_hp += (max_hp * ((spellbonuses.MaxHPChange + itembonuses.MaxHPChange) / 10000.0f)); if (cur_hp > max_hp) cur_hp = max_hp; int hp_perc_cap = spellbonuses.HPPercCap[0]; if(hp_perc_cap) { - int curHP_cap = (max_hp * hp_perc_cap) / 100; + int curHP_cap = ((max_hp * hp_perc_cap) / 100); if (cur_hp > curHP_cap || (spellbonuses.HPPercCap[1] && cur_hp > spellbonuses.HPPercCap[1])) cur_hp = curHP_cap; } @@ -265,12 +205,12 @@ int32 Client::CalcMaxHP() { return max_hp; } -uint16 Mob::GetClassLevelFactor(){ +uint16 Mob::GetClassLevelFactor() { uint16 multiplier = 0; uint8 mlevel=GetLevel(); switch(GetClass()) { - case WARRIOR:{ + case WARRIOR: { if (mlevel < 20) multiplier = 220; else if (mlevel < 30) @@ -291,7 +231,7 @@ uint16 Mob::GetClassLevelFactor(){ } case DRUID: case CLERIC: - case SHAMAN:{ + case SHAMAN: { if (mlevel < 70) multiplier = 150; else @@ -300,7 +240,7 @@ uint16 Mob::GetClassLevelFactor(){ } case BERSERKER: case PALADIN: - case SHADOWKNIGHT:{ + case SHADOWKNIGHT: { if (mlevel < 35) multiplier = 210; else if (mlevel < 45) @@ -320,7 +260,7 @@ uint16 Mob::GetClassLevelFactor(){ case MONK: case BARD: case ROGUE: - case BEASTLORD:{ + case BEASTLORD: { if (mlevel < 51) multiplier = 180; else if (mlevel < 58) @@ -331,7 +271,7 @@ uint16 Mob::GetClassLevelFactor(){ multiplier = 210; break; } - case RANGER:{ + case RANGER: { if (mlevel < 58) multiplier = 200; else if (mlevel < 70) @@ -343,14 +283,14 @@ uint16 Mob::GetClassLevelFactor(){ case MAGICIAN: case WIZARD: case NECROMANCER: - case ENCHANTER:{ + case ENCHANTER: { if (mlevel < 70) multiplier = 120; else multiplier = 127; break; } - default:{ + default: { if (mlevel < 35) multiplier = 210; else if (mlevel < 45) @@ -369,93 +309,86 @@ uint16 Mob::GetClassLevelFactor(){ return multiplier; } -int32 Client::CalcBaseHP() -{ +int32 Client::CalcBaseHP() { if(GetClientVersion() >= EQClientSoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) { int stats = GetSTA(); if(stats > 255) { - stats = (stats - 255) / 2; + stats = ((stats - 255) / 2); stats += 255; } base_hp = 5; auto base_data = database.GetBaseData(GetLevel(), GetClass()); if(base_data) { - base_hp += base_data->base_hp + (base_data->hp_factor * stats); + base_hp += (base_data->base_hp + (base_data->hp_factor * stats)); base_hp += (GetHeroicSTA() * 10); } } else { uint16 Post255; uint16 lm=GetClassLevelFactor(); - if((GetSTA()-255)/2 > 0) - Post255 = (GetSTA()-255)/2; + if(((GetSTA() - 255) / 2) > 0) + Post255 = ((GetSTA() - 255) / 2); else Post255 = 0; - base_hp = (5)+(GetLevel()*lm/10) + (((GetSTA()-Post255)*GetLevel()*lm/3000)) + ((Post255*GetLevel())*lm/6000); + base_hp = (5 + (GetLevel() * lm / 10) + (((GetSTA() - Post255) * GetLevel() * lm / 3000)) + ((Post255 * GetLevel()) * lm / 6000)); } return base_hp; } -// This is for calculating Base HPs + STA bonus for SoD or later clients. -uint32 Client::GetClassHPFactor() { - +uint32 Client::GetClassHPFactor() { // This is for calculating Base HPs + STA bonus for SoD or later clients. int factor; - - // Note: Base HP factor under level 41 is equal to factor / 12, and from level 41 to 80 is factor / 6. - // Base HP over level 80 is factor / 10 - // HP per STA point per level is factor / 30 for level 80+ - // HP per STA under level 40 is the level 80 HP Per STA / 120, and for over 40 it is / 60. - - switch(GetClass()) - { + switch(GetClass()) { //Note: Base HP factor under level 41 is equal to factor / 12, and from level 41 to 80 is factor / 6. Base HP over level 80 is factor / 10. HP per STA point per level is factor / 30 for level 80+. HP per STA under level 40 is the level 80 HP Per STA / 120, and for over 40 it is / 60. case DRUID: case ENCHANTER: case NECROMANCER: case MAGICIAN: - case WIZARD: + case WIZARD: { factor = 240; break; + } case BEASTLORD: case BERSERKER: case MONK: case ROGUE: - case SHAMAN: + case SHAMAN: { factor = 255; break; + } case BARD: - case CLERIC: + case CLERIC: { factor = 264; break; + } case SHADOWKNIGHT: - case PALADIN: + case PALADIN: { factor = 288; break; - case RANGER: + } + case RANGER: { factor = 276; break; - case WARRIOR: + } + case WARRIOR: { factor = 300; break; - default: + } + default: { factor = 240; break; + } } return factor; } -// This should return the combined AC of all the items the player is wearing. -int16 Client::GetRawItemAC() { +int16 Client::GetRawItemAC() { // This should return the combined AC of all the items the player is wearing. int16 Total = 0; - for (int16 slot_id=0; slot_id<21; slot_id++) { const ItemInst* inst = m_inv[slot_id]; - if (inst && inst->IsType(ItemClassCommon)) { + if (inst && inst->IsType(ItemClassCommon)) Total += inst->GetItem()->AC; - } } - return Total; } @@ -464,65 +397,64 @@ int16 Client::acmod() { int level = GetLevel(); if(agility < 1 || level < 1) return(0); - - if (agility <=74){ + if (agility <= 74) { if (agility == 1) return -24; - else if (agility <=3) + else if (agility <= 3) return -23; else if (agility == 4) return -22; - else if (agility <=6) + else if (agility <= 6) return -21; - else if (agility <=8) + else if (agility <= 8) return -20; else if (agility == 9) return -19; - else if (agility <=11) + else if (agility <= 11) return -18; else if (agility == 12) return -17; - else if (agility <=14) + else if (agility <= 14) return -16; - else if (agility <=16) + else if (agility <= 16) return -15; else if (agility == 17) return -14; - else if (agility <=19) + else if (agility <= 19) return -13; else if (agility == 20) return -12; - else if (agility <=22) + else if (agility <= 22) return -11; - else if (agility <=24) + else if (agility <= 24) return -10; else if (agility == 25) return -9; - else if (agility <=27) + else if (agility <= 27) return -8; else if (agility == 28) return -7; - else if (agility <=30) + else if (agility <= 30) return -6; - else if (agility <=32) + else if (agility <= 32) return -5; else if (agility == 33) return -4; - else if (agility <=35) + else if (agility <= 35) return -3; else if (agility == 36) return -2; - else if (agility <=38) + else if (agility <= 38) return -1; - else if (agility <=65) + else if (agility <= 65) return 0; - else if (agility <=70) + else if (agility <= 70) return 1; - else if (agility <=74) + else if (agility <= 74) return 5; } else if(agility <= 137) { - if (agility == 75){ + if (agility == 75) { if (level <= 6) return 9; else if (level <= 19) @@ -532,7 +464,7 @@ int16 Client::acmod() { else return 39; } - else if (agility >= 76 && agility <= 79){ + else if (agility >= 76 && agility <= 79) { if (level <= 6) return 10; else if (level <= 19) @@ -542,7 +474,7 @@ int16 Client::acmod() { else return 40; } - else if (agility == 80){ + else if (agility == 80) { if (level <= 6) return 11; else if (level <= 19) @@ -552,7 +484,7 @@ int16 Client::acmod() { else return 41; } - else if (agility >= 81 && agility <= 85){ + else if (agility >= 81 && agility <= 85) { if (level <= 6) return 12; else if (level <= 19) @@ -562,7 +494,7 @@ int16 Client::acmod() { else return 42; } - else if (agility >= 86 && agility <= 90){ + else if (agility >= 86 && agility <= 90) { if (level <= 6) return 12; else if (level <= 19) @@ -572,7 +504,7 @@ int16 Client::acmod() { else return 42; } - else if (agility >= 91 && agility <= 95){ + else if (agility >= 91 && agility <= 95) { if (level <= 6) return 13; else if (level <= 19) @@ -582,7 +514,7 @@ int16 Client::acmod() { else return 43; } - else if (agility >= 96 && agility <= 99){ + else if (agility >= 96 && agility <= 99) { if (level <= 6) return 14; else if (level <= 19) @@ -592,7 +524,7 @@ int16 Client::acmod() { else return 44; } - else if (agility == 100 && level >= 7){ + else if (agility == 100 && level >= 7) { if (level <= 19) return 28; else if (level <= 39) @@ -600,11 +532,10 @@ int16 Client::acmod() { else return 45; } - else if (level <= 6) { + else if (level <= 6) return 15; - } - //level is >6 - else if (agility >= 101 && agility <= 105){ + + else if (agility >= 101 && agility <= 105) {//level is >6 if (level <= 19) return 29; else if (level <= 39) @@ -612,7 +543,7 @@ int16 Client::acmod() { else return 45; } - else if (agility >= 106 && agility <= 110){ + else if (agility >= 106 && agility <= 110) { if (level <= 19) return 29; else if (level <= 39) @@ -620,7 +551,7 @@ int16 Client::acmod() { else return 46; } - else if (agility >= 111 && agility <= 115){ + else if (agility >= 111 && agility <= 115) { if (level <= 19) return 30; else if (level <= 39) @@ -628,7 +559,7 @@ int16 Client::acmod() { else return 47; } - else if (agility >= 116 && agility <= 119){ + else if (agility >= 116 && agility <= 119) { if (level <= 19) return 31; else if (level <= 39) @@ -639,20 +570,19 @@ int16 Client::acmod() { else if (level <= 19) { return 32; } - //level is > 19 - else if (agility == 120){ + else if (agility == 120) { //level is > 19 if (level <= 39) return 42; else return 48; } - else if (agility <= 125){ + else if (agility <= 125) { if (level <= 39) return 42; else return 49; } - else if (agility <= 135){ + else if (agility <= 135) { if (level <= 39) return 42; else @@ -664,7 +594,8 @@ int16 Client::acmod() { else return 51; } - } else if(agility <= 300) { + } + else if(agility <= 300) { if(level <= 6) { if(agility <= 139) return(21); @@ -704,7 +635,8 @@ int16 Client::acmod() { return(34); else return(35); - } else if(level <= 19) { + } + else if(level <= 19) { if(agility <= 139) return(34); else if(agility == 140) @@ -743,7 +675,8 @@ int16 Client::acmod() { return(47); else return(48); - } else if(level <= 39) { + } + else if(level <= 39) { if(agility <= 139) return(44); else if(agility == 140) @@ -782,7 +715,8 @@ int16 Client::acmod() { return(57); else return(58); - } else { //lvl >= 40 + } + else { //lvl >= 40 if(agility <= 139) return(51); else if(agility == 140) @@ -823,110 +757,97 @@ int16 Client::acmod() { return(65); } } - else{ - //seems about 21 agil per extra AC pt over 300... - return (65 + ((agility-300) / 21)); - } + else //seems about 21 agil per extra AC pt over 300... + return (65 + ((agility - 300) / 21)); #if EQDEBUG >= 11 LogFile->write(EQEMuLog::Error, "Error in Client::acmod(): Agility: %i, Level: %i",agility,level); #endif return 0; }; -// This is a testing formula for AC, the value this returns should be the same value as the one the client shows... -// ac1 and ac2 are probably the damage migitation and damage avoidance numbers, not sure which is which. -// I forgot to include the iksar defense bonus and i cant find my notes now... -// AC from spells are not included (cant even cast spells yet..) -int16 Client::CalcAC() { - - // new formula - int avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)*16)/9); +int32 Client::CalcAC() { //This is a testing formula for AC, the value this returns should be the same value as the one the client shows... ac1 and ac2 are probably the damage migitation and damage avoidance numbers, not sure which is which. I forgot to include the iksar defense bonus and i cant find my notes now... AC from spells are not included (cant even cast spells yet..) + int avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9); // new formula + if (avoidance < 0) avoidance = 0; - + if (avoidance > RuleI(Combat, AvoidanceCap)) + avoidance = RuleI(Combat, AvoidanceCap); + int mitigation = 0; + if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) { - //something is wrong with this, naked casters have the wrong natural AC -// mitigation = (spellbonuses.AC/3) + (GetSkill(DEFENSE)/2) + (itembonuses.AC+1); - mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)/4 + (itembonuses.AC+1); - //this might be off by 4.. - mitigation -= 4; - } else { -// mitigation = (spellbonuses.AC/4) + (GetSkill(DEFENSE)/3) + ((itembonuses.AC*4)/3); - mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)/3 + ((itembonuses.AC*4)/3); - if(m_pp.class_ == MONK) - mitigation += GetLevel() * 13/10; //the 13/10 might be wrong, but it is close... + mitigation = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1)); //something is wrong with this, naked casters have the wrong natural AC - mitigation = (spellbonuses.AC/3) + (GetSkill(DEFENSE)/2) + (itembonuses.AC+1); + mitigation -= 4; //this might be off by 4.. } + else { + mitigation = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 3 + ((itembonuses.AC * 4) / 3)); //mitigation = (spellbonuses.AC/4) + (GetSkill(DEFENSE)/3) + ((itembonuses.AC*4)/3); + if(m_pp.class_ == MONK) + mitigation += (GetLevel() * 1.3); //the 13 / 10 might be wrong, but it is close... + } + int displayed = 0; - displayed += ((avoidance+mitigation)*1000)/847; //natural AC - - //Iksar AC, untested - if (GetRace() == IKSAR) { + displayed += (((avoidance + mitigation) * 1000) / 847); //natural AC + + if (GetRace() == IKSAR) { //Iksar AC displayed += 12; int iksarlevel = GetLevel(); iksarlevel -= 10; if (iksarlevel > 25) iksarlevel = 25; if (iksarlevel > 0) - displayed += iksarlevel * 12 / 10; + displayed += (iksarlevel * 1.2); } - - // Shield AC bonus for HeroicSTR - if(itembonuses.HeroicSTR) { - bool equiped = CastToClient()->m_inv.GetItem(14); - if(equiped) { + if(itembonuses.HeroicSTR) { //Shield AC bonus for HeroicSTR + bool equipped = CastToClient()->m_inv.GetItem(14); + if(equipped) { uint8 shield = CastToClient()->m_inv.GetItem(14)->GetItem()->ItemType; if(shield == ItemTypeShield) - displayed += itembonuses.HeroicSTR/2; + displayed += (itembonuses.HeroicSTR / 2); } } - - //spell AC bonuses are added directly to natural total - displayed += spellbonuses.AC; - + + displayed += spellbonuses.AC; //spell AC bonuses are added directly to natural total AC = displayed; return(AC); } int16 Client::GetACMit() { - int mitigation = 0; + if (m_pp.class_ == WIZARD || m_pp.class_ == MAGICIAN || m_pp.class_ == NECROMANCER || m_pp.class_ == ENCHANTER) { - mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)/4 + (itembonuses.AC+1); + mitigation = ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) / 4 + (itembonuses.AC + 1)); mitigation -= 4; } else { mitigation = (GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)/3 + ((itembonuses.AC*4)/3); if(m_pp.class_ == MONK) - mitigation += GetLevel() * 13/10; //the 13/10 might be wrong, but it is close... + mitigation += (GetLevel() * 1.3); //the 13/10 might be wrong, but it is close... } - - // Shield AC bonus for HeroicSTR - if(itembonuses.HeroicSTR) { + if(itembonuses.HeroicSTR) { //Shield AC bonus for HeroicSTR bool equiped = CastToClient()->m_inv.GetItem(14); if(equiped) { uint8 shield = CastToClient()->m_inv.GetItem(14)->GetItem()->ItemType; if(shield == ItemTypeShield) - mitigation += itembonuses.HeroicSTR/2; + mitigation += (itembonuses.HeroicSTR / 2); } } - return(mitigation*1000/847); + return(mitigation * 1000 / 847); } int16 Client::GetACAvoid() { - - int avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI/10)*16)/9); + int avoidance = (acmod() + ((GetSkill(SkillDefense) + itembonuses.HeroicAGI / 10) * 16) / 9); + if (avoidance < 0) avoidance = 0; + if (avoidance > RuleI(Combat, AvoidanceCap)) + avoidance = RuleI(Combat, AvoidanceCap); - return(avoidance*1000/847); + return(avoidance * 1000 / 847); } -int32 Client::CalcMaxMana() -{ - switch(GetCasterClass()) - { +int32 Client::CalcMaxMana() { + switch(GetCasterClass()) { case 'I': case 'W': { max_mana = (CalcBaseMana() + itembonuses.Mana + spellbonuses.Mana + GroupLeadershipAAManaEnhancement()); @@ -942,17 +863,16 @@ int32 Client::CalcMaxMana() break; } } - if (max_mana < 0) { + if (max_mana < 0) max_mana = 0; - } - - if (cur_mana > max_mana) { + if (cur_mana > max_mana) cur_mana = max_mana; - } int mana_perc_cap = spellbonuses.ManaPercCap[0]; + if(mana_perc_cap) { - int curMana_cap = (max_mana * mana_perc_cap) / 100; + int curMana_cap = ((max_mana * mana_perc_cap) / 100); + if (cur_mana > curMana_cap || (spellbonuses.ManaPercCap[1] && cur_mana > spellbonuses.ManaPercCap[1])) cur_mana = curMana_cap; } @@ -963,40 +883,32 @@ int32 Client::CalcMaxMana() return max_mana; } -int32 Client::CalcBaseMana() -{ +int32 Client::CalcBaseMana() { int WisInt = 0; int MindLesserFactor, MindFactor; int32 max_m = 0; int wisint_mana = 0; int base_mana = 0; int ConvertedWisInt = 0; - switch(GetCasterClass()) - { + switch(GetCasterClass()) { case 'I': WisInt = GetINT(); - if (GetClientVersion() >= EQClientSoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) { - if (WisInt > 100) { ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100); - if (WisInt > 201) { + if (WisInt > 201) ConvertedWisInt -= ((WisInt - 201) * 5 / 4); - } } - else { + else ConvertedWisInt = WisInt; - } auto base_data = database.GetBaseData(GetLevel(), GetClass()); - if(base_data) { - max_m = base_data->base_mana + (ConvertedWisInt * base_data->mana_factor) + (GetHeroicINT() * 10); - } + if(base_data) + max_m = (base_data->base_mana + (ConvertedWisInt * base_data->mana_factor) + (GetHeroicINT() * 10)); } - else - { - if((( WisInt - 199 ) / 2) > 0) - MindLesserFactor = ( WisInt - 199 ) / 2; + else { + if(((WisInt - 199) / 2) > 0) + MindLesserFactor = ((WisInt - 199) / 2); else MindLesserFactor = 0; @@ -1007,42 +919,34 @@ int32 Client::CalcBaseMana() max_m = (((5 * (MindFactor + 200)) / 2) * 3 * GetLevel() / 100); } break; - case 'W': WisInt = GetWIS(); - if (GetClientVersion() >= EQClientSoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) { - if (WisInt > 100) { ConvertedWisInt = (((WisInt - 100) * 5 / 2) + 100); - if (WisInt > 201) { + if (WisInt > 201) ConvertedWisInt -= ((WisInt - 201) * 5 / 4); - } } - else { + else ConvertedWisInt = WisInt; - } auto base_data = database.GetBaseData(GetLevel(), GetClass()); - if(base_data) { - max_m = base_data->base_mana + (ConvertedWisInt * base_data->mana_factor) + (GetHeroicWIS() * 10); - } + if(base_data) + max_m = (base_data->base_mana + (ConvertedWisInt * base_data->mana_factor) + (GetHeroicWIS() * 10)); } - else - { + else { if((( WisInt - 199 ) / 2) > 0) - MindLesserFactor = ( WisInt - 199 ) / 2; + MindLesserFactor = ((WisInt - 199) / 2); else MindLesserFactor = 0; - MindFactor = WisInt - MindLesserFactor; + MindFactor = (WisInt - MindLesserFactor); if(WisInt > 100) max_m = (((5 * (MindFactor + 20)) / 2) * 3 * GetLevel() / 40); else max_m = (((5 * (MindFactor + 200)) / 2) * 3 * GetLevel() / 100); } break; - case 'N': { max_m = 0; break; @@ -1060,56 +964,45 @@ int32 Client::CalcBaseMana() return max_m; } -int32 Client::CalcBaseManaRegen() -{ +int32 Client::CalcBaseManaRegen() { uint8 clevel = GetLevel(); int32 regen = 0; - if (IsSitting() || (GetHorseId() != 0)) - { + if (IsSitting() || (GetHorseId() != 0)) { if(HasSkill(SkillMeditate)) - regen = (((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4; + regen = ((((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4); else regen = 2; } - else { + else regen = 2; - } return regen; } -int32 Client::CalcManaRegen() -{ +int32 Client::CalcManaRegen() { uint8 clevel = GetLevel(); int32 regen = 0; - //this should be changed so we dont med while camping, etc... - if (IsSitting() || (GetHorseId() != 0)) - { + if (IsSitting() || (GetHorseId() != 0)) { //this should be changed so we dont med while camping, etc... BuffFadeBySitModifier(); if(HasSkill(SkillMeditate)) { this->medding = true; - regen = (((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4; - regen += spellbonuses.ManaRegen + itembonuses.ManaRegen; + regen = ((((GetSkill(SkillMeditate) / 10) + (clevel - (clevel / 4))) / 4) + 4); + regen += (spellbonuses.ManaRegen + itembonuses.ManaRegen); CheckIncreaseSkill(SkillMeditate, nullptr, -5); } else - regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen; + regen = (2 + spellbonuses.ManaRegen + itembonuses.ManaRegen); } else { this->medding = false; - regen = 2 + spellbonuses.ManaRegen + itembonuses.ManaRegen; + regen = (2 + spellbonuses.ManaRegen + itembonuses.ManaRegen); } - - //AAs - regen += aabonuses.ManaRegen; - + regen += aabonuses.ManaRegen; //AAs return (regen * RuleI(Character, ManaRegenMultiplier) / 100); } -int32 Client::CalcManaRegenCap() -{ +int32 Client::CalcManaRegenCap() { int32 cap = RuleI(Character, ItemManaRegenCap) + aabonuses.ItemManaRegenCap; - switch(GetCasterClass()) - { + switch(GetCasterClass()) { case 'I': cap += (itembonuses.HeroicINT / 25); break; @@ -1117,18 +1010,15 @@ int32 Client::CalcManaRegenCap() cap += (itembonuses.HeroicWIS / 25); break; } - return (cap * RuleI(Character, ManaRegenMultiplier) / 100); } uint32 Client::CalcCurrentWeight() { - const Item_Struct* TempItem = 0; ItemInst* ins; uint32 Total = 0; int x; - for(x = 0; x <= 30; x++) - { + for(x = 0; x <= 30; x++) { TempItem = 0; ins = GetInv().GetItem(x); if (ins) @@ -1136,8 +1026,7 @@ uint32 Client::CalcCurrentWeight() { if (TempItem) Total += TempItem->Weight; } - for (x = 251; x < 331; x++) - { + for (x = 251; x < 331; x++) { int TmpWeight = 0; TempItem = 0; ins = GetInv().GetItem(x); @@ -1145,12 +1034,10 @@ uint32 Client::CalcCurrentWeight() { TempItem = ins->GetItem(); if (TempItem) TmpWeight = TempItem->Weight; - if (TmpWeight > 0) - { + if (TmpWeight > 0) { int bagslot = 22; int reduction = 0; - for (int m = 261; m < 331; m += 10) - { + for (int m = 261; m < 331; m += 10) { if (x >= m) bagslot += 1; } @@ -1158,297 +1045,180 @@ uint32 Client::CalcCurrentWeight() { if (baginst && baginst->GetItem() && baginst->IsType(ItemClassContainer)) reduction = baginst->GetItem()->BagWR; if (reduction > 0) - TmpWeight -= TmpWeight*reduction/100; + TmpWeight -= (TmpWeight * reduction / 100); Total += TmpWeight; } } - - //TODO: coin weight reduction (from purses, etc), since client already calculates it - /*From the Wiki http://www.eqemulator.net/wiki/wikka.php?wakka=EQEmuDBSchemaitems under bagwr (thanks Trevius): - Interestingly, you can also have bags that reduce coin weight. However, in order to set bags to reduce coin weight, you MUST set the Item ID somewhere between 17201 and 17230. This is hard coded into the client. - The client is set to have certain coin weight reduction on a per Item ID basis within this range. The best way to create an new item to reduce coin weight is to examine existing bags in this range. - Search for the words "coin purse" with the #finditem command in game and the Bag WR setting on those bags is the amount they will reduce coin weight. It is easiest to overwrite one of those bags if you wish to create one with the - same weight reduction amount for coins. You can use other Item IDs in this range for setting coin weight reduction, but by using an existing item, at least you will know the amount the client will reduce it by before you create it. - This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd. - */ - - // SoD client has no weight for coin - if (GetClientVersion() < EQClientSoD) { - Total += (m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4; - } + + if (GetClientVersion() < EQClientSoD) // //TODO: coin weight reduction (from purses, etc), since client already calculates it. From the Wiki http://www.eqemulator.net/wiki/wikka.php?wakka=EQEmuDBSchemaitems under bagwr (thanks Trevius): Interestingly, you can also have bags that reduce coin weight. However, in order to set bags to reduce coin weight, you MUST set the Item ID somewhere between 17201 and 17230. This is hard coded into the client. The client is set to have certain coin weight reduction on a per Item ID basis within this range. The best way to create an new item to reduce coin weight is to examine existing bags in this range. Search for the words "coin purse" with the #finditem command in game and the Bag WR setting on those bags is the amount they will reduce coin weight. It is easiest to overwrite one of those bags if you wish to create one with the same weight reduction amount for coins. You can use other Item IDs in this range for setting coin weight reduction, but by using an existing item, at least you will know the amount the client will reduce it by before you create it. This is the ONLY instance I have seen where the client is hard coded to particular Item IDs to set a certain property for an item. It is very odd. - SoD client has no weight for coin + Total += ((m_pp.platinum + m_pp.gold + m_pp.silver + m_pp.copper) / 4); float Packrat = (float)spellbonuses.Packrat + (float)aabonuses.Packrat; if (Packrat > 0) - Total = (uint32)((float)Total * (1.0f - ((Packrat * 1.0f) / 100.0f))); //AndMetal: 1% per level, up to 5% (calculated from Titanium client). verified thru client that it reduces coin weight by the same % - //without casting to float & back to uint32, this didn't work right + Total = ((uint32)((float)Total * (1.0f - ((Packrat * 1.0f) / 100.0f)))); //AndMetal: 1% per level, up to 5% (calculated from Titanium client). verified thru client that it reduces coin weight by the same % without casting to float & back to uint32, this didn't work right return Total; } -int16 Client::CalcAlcoholPhysicalEffect() -{ +int16 Client::CalcAlcoholPhysicalEffect() { if(m_pp.intoxication <= 55) return 0; - return (m_pp.intoxication - 40) / 16; + return((m_pp.intoxication - 40) / 16); } int16 Client::CalcSTR() { - int16 val = m_pp.STR + itembonuses.STR + spellbonuses.STR + CalcAlcoholPhysicalEffect(); - + int16 val = (m_pp.STR + itembonuses.STR + spellbonuses.STR + CalcAlcoholPhysicalEffect()); int16 mod = aabonuses.STR; - - STR = val + mod; - + STR = (val + mod); if(STR < 1) STR = 1; - int m = GetMaxSTR(); if(STR > m) STR = m; - return(STR); } int16 Client::CalcSTA() { - int16 val = m_pp.STA + itembonuses.STA + spellbonuses.STA + CalcAlcoholPhysicalEffect();; - + int16 val = (m_pp.STA + itembonuses.STA + spellbonuses.STA + CalcAlcoholPhysicalEffect()); int16 mod = aabonuses.STA; - - STA = val + mod; - + STA = (val + mod); if(STA < 1) STA = 1; - int m = GetMaxSTA(); if(STA > m) STA = m; - return(STA); } int16 Client::CalcAGI() { - int16 val = m_pp.AGI + itembonuses.AGI + spellbonuses.AGI - CalcAlcoholPhysicalEffect();; + int16 val = (m_pp.AGI + itembonuses.AGI + spellbonuses.AGI - CalcAlcoholPhysicalEffect()); int16 mod = aabonuses.AGI; - - int16 str = GetSTR(); - - //Encumbered penalty - if(weight > (str * 10)) { - //AGI is halved when we double our weight, zeroed (defaults to 1) when we triple it. this includes AGI from AAs + int16 str = GetSTR(); + if(weight > (str * 10)) { //Encumbered penalty - AGI is halved when we double our weight, zeroed (defaults to 1) when we triple it. this includes AGI from AAs float total_agi = float(val + mod); float str_float = float(str); - AGI = (int16)(((-total_agi) / (str_float * 2)) * (((float)weight / 10) - str_float) + total_agi); //casting to an int assumes this will be floor'd. without using floats & casting to int16, the calculation doesn't work right - } else - AGI = val + mod; - + AGI = (int16)(((-total_agi) / (str_float * 2)) * (((float)weight / 10) - str_float) + total_agi); //casting to an int assumes this will be floor'd. without using floats & casting to int16, the calculation doesn't work right + } + else + AGI = (val + mod); if(AGI < 1) AGI = 1; - int m = GetMaxAGI(); if(AGI > m) AGI = m; - return(AGI); } int16 Client::CalcDEX() { - int16 val = m_pp.DEX + itembonuses.DEX + spellbonuses.DEX - CalcAlcoholPhysicalEffect();; - + int16 val = (m_pp.DEX + itembonuses.DEX + spellbonuses.DEX - CalcAlcoholPhysicalEffect()); int16 mod = aabonuses.DEX; - - DEX = val + mod; - + DEX = (val + mod); if(DEX < 1) DEX = 1; - int m = GetMaxDEX(); if(DEX > m) DEX = m; - return(DEX); } int16 Client::CalcINT() { - int16 val = m_pp.INT + itembonuses.INT + spellbonuses.INT; - + int16 val = (m_pp.INT + itembonuses.INT + spellbonuses.INT); int16 mod = aabonuses.INT; - - INT = val + mod; - - if(m_pp.intoxication) - { - int16 AlcINT = INT - (int16)((float)m_pp.intoxication / 200.0f * (float)INT) - 1; - + INT = (val + mod); + if(m_pp.intoxication) { + int16 AlcINT = (INT - (int16)((float)m_pp.intoxication / 200.0f * (float)INT) - 1); if((AlcINT < (int)(0.2 * INT))) INT = (int)(0.2f * (float)INT); else INT = AlcINT; } - if(INT < 1) INT = 1; - int m = GetMaxINT(); if(INT > m) INT = m; - return(INT); } int16 Client::CalcWIS() { - int16 val = m_pp.WIS + itembonuses.WIS + spellbonuses.WIS; - + int16 val = (m_pp.WIS + itembonuses.WIS + spellbonuses.WIS); int16 mod = aabonuses.WIS; - - WIS = val + mod; - - if(m_pp.intoxication) - { - int16 AlcWIS = WIS - (int16)((float)m_pp.intoxication / 200.0f * (float)WIS) - 1; - + WIS = (val + mod); + if(m_pp.intoxication) { + int16 AlcWIS = (WIS - (int16)((float)m_pp.intoxication / 200.0f * (float)WIS) - 1); if((AlcWIS < (int)(0.2 * WIS))) WIS = (int)(0.2f * (float)WIS); else WIS = AlcWIS; } - if(WIS < 1) WIS = 1; - int m = GetMaxWIS(); if(WIS > m) WIS = m; - return(WIS); } int16 Client::CalcCHA() { - int16 val = m_pp.CHA + itembonuses.CHA + spellbonuses.CHA; - + int16 val = (m_pp.CHA + itembonuses.CHA + spellbonuses.CHA); int16 mod = aabonuses.CHA; - - CHA = val + mod; - + CHA = (val + mod); if(CHA < 1) CHA = 1; - int m = GetMaxCHA(); if(CHA > m) CHA = m; - return(CHA); } int Client::CalcHaste() { - int h = spellbonuses.haste + spellbonuses.hastetype2; + int h = (spellbonuses.haste + spellbonuses.hastetype2); int cap = 0; int overhaste = 0; - int level = GetLevel(); - - // 26+ no cap, 1-25 10 + int level = GetLevel(); // 26+ no cap, 1-25 10 if (level > 25) // 26+ h += itembonuses.haste; else // 1-25 - h += itembonuses.haste > 10 ? 10 : itembonuses.haste; - - // 60+ 100, 51-59 85, 1-50 level+25 + h += itembonuses.haste > 10 ? 10 : itembonuses.haste;// 60+ 100, 51-59 85, 1-50 level+25 + if (level > 59) // 60+ cap = RuleI(Character, HasteCap); else if (level > 50) // 51-59 cap = 85; else // 1-50 - cap = level + 25; - + cap = (level + 25); cap = mod_client_haste_cap(cap); - if (h > cap) h = cap; - - // 51+ 25 (despite there being higher spells...), 1-50 10 - if (level > 50) // 51+ + + if (level > 50) // 51+ 25 (despite there being higher spells...), 1-50 10 - 51+ overhaste = spellbonuses.hastetype3 > 25 ? 25 : spellbonuses.hastetype3; else // 1-50 overhaste = spellbonuses.hastetype3 > 10 ? 10 : spellbonuses.hastetype3; - h += overhaste; - h += ExtraHaste; //GM granted haste. - + h += ExtraHaste; //GM granted haste. h = mod_client_haste(h); - if (spellbonuses.inhibitmelee) { if (h >= 0) h -= spellbonuses.inhibitmelee; else h -= ((100 + h) * spellbonuses.inhibitmelee / 100); } - Haste = h; return(Haste); } -//The AA multipliers are set to be 5, but were 2 on WR -//The resistant discipline which I think should be here is implemented -//in Mob::ResistSpell -int16 Client::CalcMR() -{ - //racial bases - switch(GetBaseRace()) { - case HUMAN: - MR = 25; - break; - case BARBARIAN: - MR = 25; - break; - case ERUDITE: - MR = 30; - break; - case WOOD_ELF: - MR = 25; - break; - case HIGH_ELF: - MR = 25; - break; - case DARK_ELF: - MR = 25; - break; - case HALF_ELF: - MR = 25; - break; - case DWARF: - MR = 30; - break; - case TROLL: - MR = 25; - break; - case OGRE: - MR = 25; - break; - case HALFLING: - MR = 25; - break; - case GNOME: - MR = 25; - break; - case IKSAR: - MR = 25; - break; - case VAHSHIR: - MR = 25; - break; - case FROGLOK: - MR = 30; - break; - case DRAKKIN: - MR = 35; - break; - default: - MR = 20; - } +int16 Client::CalcMR() { //The AA multipliers are set to be 5, but were 2 on WR - The resistant discipline which I think should be here is implemented in Mob::ResistSpell + MR = 25; + if (GetBaseRace() == ERUDITE || GetBaseRace() == DWARF || GetBaseRace() == FROGLOK) + MR = 30; + else if (GetBaseRace() == DRAKKIN) + MR = 35; - MR += itembonuses.MR + spellbonuses.MR + aabonuses.MR; + MR += (itembonuses.MR + spellbonuses.MR + aabonuses.MR); if(GetClass() == WARRIOR) - MR += GetLevel() / 2; + MR += (GetLevel() / 2); if(MR < 1) MR = 1; @@ -1459,72 +1229,22 @@ int16 Client::CalcMR() return(MR); } -int16 Client::CalcFR() -{ - //racial bases - switch(GetBaseRace()) { - case HUMAN: - FR = 25; - break; - case BARBARIAN: - FR = 25; - break; - case ERUDITE: - FR = 25; - break; - case WOOD_ELF: - FR = 25; - break; - case HIGH_ELF: - FR = 25; - break; - case DARK_ELF: - FR = 25; - break; - case HALF_ELF: - FR = 25; - break; - case DWARF: - FR = 25; - break; - case TROLL: - FR = 5; - break; - case OGRE: - FR = 25; - break; - case HALFLING: - FR = 25; - break; - case GNOME: - FR = 25; - break; - case IKSAR: - FR = 30; - break; - case VAHSHIR: - FR = 25; - break; - case FROGLOK: - FR = 25; - break; - case DRAKKIN: - FR = 25; - break; - default: - FR = 20; - } +int16 Client::CalcFR() { + FR = 25; + if (GetBaseRace() == TROLL) + FR = 5; + else if (GetBaseRace() == IKSAR) + FR = 30; int c = GetClass(); if(c == RANGER) { FR += 4; - int l = GetLevel(); if(l > 49) - FR += l - 49; + FR += (l - 49); } - FR += itembonuses.FR + spellbonuses.FR + aabonuses.FR; + FR += (itembonuses.FR + spellbonuses.FR + aabonuses.FR); if(FR < 1) FR = 1; @@ -1535,79 +1255,28 @@ int16 Client::CalcFR() return(FR); } -int16 Client::CalcDR() -{ - //racial bases - switch(GetBaseRace()) { - case HUMAN: - DR = 15; - break; - case BARBARIAN: - DR = 15; - break; - case ERUDITE: - DR = 10; - break; - case WOOD_ELF: - DR = 15; - break; - case HIGH_ELF: - DR = 15; - break; - case DARK_ELF: - DR = 15; - break; - case HALF_ELF: - DR = 15; - break; - case DWARF: - DR = 15; - break; - case TROLL: - DR = 15; - break; - case OGRE: - DR = 15; - break; - case HALFLING: - DR = 20; - break; - case GNOME: - DR = 15; - break; - case IKSAR: - DR = 15; - break; - case VAHSHIR: - DR = 15; - break; - case FROGLOK: - DR = 15; - break; - case DRAKKIN: - DR = 15; - break; - default: - DR = 15; - } +int16 Client::CalcDR() { + DR = 15; + if (GetBaseRace() == ERUDITE) + DR = 10; + else if (GetBaseRace() == HALFLING) + DR = 20; int c = GetClass(); if(c == PALADIN) { DR += 8; - int l = GetLevel(); if(l > 49) - DR += l - 49; - - } else if(c == SHADOWKNIGHT) { + DR += (l - 49); + } + else if(c == SHADOWKNIGHT) { DR += 4; - int l = GetLevel(); if(l > 49) - DR += l - 49; + DR += (l - 49); } - DR += itembonuses.DR + spellbonuses.DR + aabonuses.DR; + DR += (itembonuses.DR + spellbonuses.DR + aabonuses.DR); if(DR < 1) DR = 1; @@ -1618,79 +1287,28 @@ int16 Client::CalcDR() return(DR); } -int16 Client::CalcPR() -{ - //racial bases - switch(GetBaseRace()) { - case HUMAN: - PR = 15; - break; - case BARBARIAN: - PR = 15; - break; - case ERUDITE: - PR = 15; - break; - case WOOD_ELF: - PR = 15; - break; - case HIGH_ELF: - PR = 15; - break; - case DARK_ELF: - PR = 15; - break; - case HALF_ELF: - PR = 15; - break; - case DWARF: - PR = 20; - break; - case TROLL: - PR = 15; - break; - case OGRE: - PR = 15; - break; - case HALFLING: - PR = 20; - break; - case GNOME: - PR = 15; - break; - case IKSAR: - PR = 15; - break; - case VAHSHIR: - PR = 15; - break; - case FROGLOK: - PR = 30; - break; - case DRAKKIN: - PR = 15; - break; - default: - PR = 15; - } +int16 Client::CalcPR() { + PR = 15; + if (GetBaseRace() == DWARF || GetBaseRace() == HALFLING) + PR = 20; + else if (GetBaseRace() == FROGLOK) + PR = 30; int c = GetClass(); if(c == ROGUE) { PR += 8; - int l = GetLevel(); if(l > 49) - PR += l - 49; - - } else if(c == SHADOWKNIGHT) { + PR += (l - 49); + } + else if(c == SHADOWKNIGHT) { PR += 4; - int l = GetLevel(); if(l > 49) - PR += l - 49; + PR += (l - 49); } - PR += itembonuses.PR + spellbonuses.PR + aabonuses.PR; + PR += (itembonuses.PR + spellbonuses.PR + aabonuses.PR); if(PR < 1) PR = 1; @@ -1701,72 +1319,22 @@ int16 Client::CalcPR() return(PR); } -int16 Client::CalcCR() -{ - //racial bases - switch(GetBaseRace()) { - case HUMAN: - CR = 25; - break; - case BARBARIAN: - CR = 35; - break; - case ERUDITE: - CR = 25; - break; - case WOOD_ELF: - CR = 25; - break; - case HIGH_ELF: - CR = 25; - break; - case DARK_ELF: - CR = 25; - break; - case HALF_ELF: - CR = 25; - break; - case DWARF: - CR = 25; - break; - case TROLL: - CR = 25; - break; - case OGRE: - CR = 25; - break; - case HALFLING: - CR = 25; - break; - case GNOME: - CR = 25; - break; - case IKSAR: - CR = 15; - break; - case VAHSHIR: - CR = 25; - break; - case FROGLOK: - CR = 25; - break; - case DRAKKIN: - CR = 25; - break; - default: - CR = 25; - } +int16 Client::CalcCR() { + CR = 25; + if (GetBaseRace() == BARBARIAN) + CR = 35; + else if (GetBaseRace() == IKSAR) + CR = 15; int c = GetClass(); if(c == RANGER) { CR += 4; - int l = GetLevel(); if(l > 49) - CR += l - 49; + CR += (l - 49); } - CR += itembonuses.CR + spellbonuses.CR + aabonuses.CR; + CR += (itembonuses.CR + spellbonuses.CR + aabonuses.CR); if(CR < 1) CR = 1; @@ -1777,9 +1345,8 @@ int16 Client::CalcCR() return(CR); } -int16 Client::CalcCorrup() -{ - Corrup = GetBaseCorrup() + itembonuses.Corrup + spellbonuses.Corrup + aabonuses.Corrup; +int16 Client::CalcCorrup() { + Corrup = (GetBaseCorrup() + itembonuses.Corrup + spellbonuses.Corrup + aabonuses.Corrup); if(Corrup > GetMaxCorrup()) Corrup = GetMaxCorrup(); @@ -1788,24 +1355,18 @@ int16 Client::CalcCorrup() } int16 Client::CalcATK() { - ATK = itembonuses.ATK + spellbonuses.ATK + aabonuses.ATK + GroupLeadershipAAOffenseEnhancement(); + ATK = (itembonuses.ATK + spellbonuses.ATK + aabonuses.ATK + GroupLeadershipAAOffenseEnhancement()); return(ATK); } -uint16 Mob::GetInstrumentMod(uint16 spell_id) const -{ +uint16 Mob::GetInstrumentMod(uint16 spell_id) const { if (GetClass() != BARD) return 10; uint16 effectmod = 10; int effectmodcap = RuleI(Character, BaseInstrumentSoftCap); - - //this should never use spell modifiers... - //if a spell grants better modifers, they are copied into the item mods - //because the spells are supposed to act just like having the intrument. - - //item mods are in 10ths of percent increases - switch (spells[spell_id].skill) { + + switch (spells[spell_id].skill) { //this should never use spell modifiers... if a spell grants better modifiers, they are copied into the item mods because the spells are supposed to act just like having the instrument. item mods are in 10ths of percent increases case SkillPercussionInstruments: if(itembonuses.percussionMod == 0 && spellbonuses.percussionMod == 0) effectmod = 10; @@ -1857,14 +1418,14 @@ uint16 Mob::GetInstrumentMod(uint16 spell_id) const effectmod = itembonuses.singingMod; else effectmod = spellbonuses.singingMod; - effectmod += aabonuses.singingMod + spellbonuses.Amplification; + effectmod += (aabonuses.singingMod + spellbonuses.Amplification); break; default: effectmod = 10; break; } - effectmodcap += aabonuses.songModCap + spellbonuses.songModCap; + effectmodcap += (aabonuses.songModCap + spellbonuses.songModCap); if (effectmod < 10) effectmod = 10; @@ -1872,55 +1433,45 @@ uint16 Mob::GetInstrumentMod(uint16 spell_id) const if (effectmod > effectmodcap) effectmod = effectmodcap; - _log(SPELLS__BARDS, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", - GetName(), spell_id, effectmod, effectmodcap); - + _log(SPELLS__BARDS, "%s::GetInstrumentMod() spell=%d mod=%d modcap=%d\n", GetName(), spell_id, effectmod, effectmodcap); return effectmod; } -void Client::CalcMaxEndurance() -{ - max_end = CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance; +void Client::CalcMaxEndurance() { + max_end = (CalcBaseEndurance() + spellbonuses.Endurance + itembonuses.Endurance); - if (max_end < 0) { + if (max_end < 0) max_end = 0; - } - - if (cur_end > max_end) { + if (cur_end > max_end) cur_end = max_end; - } int end_perc_cap = spellbonuses.EndPercCap[0]; if(end_perc_cap) { - int curEnd_cap = (max_end * end_perc_cap) / 100; + int curEnd_cap = ((max_end * end_perc_cap) / 100); if (cur_end > curEnd_cap || (spellbonuses.EndPercCap[1] && cur_end > spellbonuses.EndPercCap[1])) cur_end = curEnd_cap; } } -int32 Client::CalcBaseEndurance() -{ +int32 Client::CalcBaseEndurance() { int32 base_end = 0; if(GetClientVersion() >= EQClientSoF && RuleB(Character, SoDClientUseSoDHPManaEnd)) { - double heroic_stats = (GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4.0f; - double stats = (GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4.0f; + double heroic_stats = ((GetHeroicSTR() + GetHeroicSTA() + GetHeroicDEX() + GetHeroicAGI()) / 4.0f); + double stats = ((GetSTR() + GetSTA() + GetDEX() + GetAGI()) / 4.0f); - if(stats > 201.0f) { - stats = 1.25f * (stats - 201.0f) + 352.5f; - } else if(stats > 100.0f) { - stats = 2.5f * (stats - 100.0f) + 100.0f; - } + if(stats > 201.0f) + stats = (1.25f * (stats - 201.0f) + 352.5f); + else if(stats > 100.0f) + stats = (2.5f * (stats - 100.0f) + 100.0f); auto base_data = database.GetBaseData(GetLevel(), GetClass()); - if(base_data) { - base_end = base_data->base_end + (heroic_stats * 10.0f) + (base_data->endurance_factor * static_cast(stats)); - } + if(base_data) + base_end = (base_data->base_end + (heroic_stats * 10.0f) + (base_data->endurance_factor * static_cast(stats))); } - else - { - int Stats = GetSTR()+GetSTA()+GetDEX()+GetAGI(); - int LevelBase = GetLevel() * 15; + else { + int Stats = (GetSTR() + GetSTA() + GetDEX() + GetAGI()); + int LevelBase = (GetLevel() * 15); int at_most_800 = Stats; if(at_most_800 > 800) @@ -1931,55 +1482,47 @@ int32 Client::CalcBaseEndurance() int Bonus800plus = 0; int HalfBonus800plus = 0; - int BonusUpto800 = int( at_most_800 / 4 ) ; + int BonusUpto800 = int(at_most_800 / 4); if(Stats > 400) { - Bonus400to800 = int( (at_most_800 - 400) / 4 ); - HalfBonus400to800 = int( std::max( ( at_most_800 - 400 ), 0 ) / 8 ); + Bonus400to800 = int((at_most_800 - 400) / 4); + HalfBonus400to800 = int(std::max((at_most_800 - 400), 0) / 8); if(Stats > 800) { - Bonus800plus = int( (Stats - 800) / 8 ) * 2; - HalfBonus800plus = int( (Stats - 800) / 16 ); + Bonus800plus = (int((Stats - 800) / 8 ) * 2); + HalfBonus800plus = int((Stats - 800) / 16); } } - int bonus_sum = BonusUpto800 + Bonus400to800 + HalfBonus400to800 + Bonus800plus + HalfBonus800plus; + int bonus_sum = (BonusUpto800 + Bonus400to800 + HalfBonus400to800 + Bonus800plus + HalfBonus800plus); base_end = LevelBase; //take all of the sums from above, then multiply by level*0.075 - base_end += ( bonus_sum * 3 * GetLevel() ) / 40; + base_end += ((bonus_sum * 3 * GetLevel()) / 40); } - return base_end; } int32 Client::CalcEnduranceRegen() { - int32 regen = int32(GetLevel() * 4 / 10) + 2; - regen += aabonuses.EnduranceRegen + spellbonuses.EnduranceRegen + itembonuses.EnduranceRegen; - + int32 regen = (int32(GetLevel() * 4 / 10) + 2); + regen += (aabonuses.EnduranceRegen + spellbonuses.EnduranceRegen + itembonuses.EnduranceRegen); return (regen * RuleI(Character, EnduranceRegenMultiplier) / 100); } int32 Client::CalcEnduranceRegenCap() { int cap = (RuleI(Character, ItemEnduranceRegenCap) + itembonuses.HeroicSTR/25 + itembonuses.HeroicDEX/25 + itembonuses.HeroicAGI/25 + itembonuses.HeroicSTA/25); - return (cap * RuleI(Character, EnduranceRegenMultiplier) / 100); } -int Client::GetRawACNoShield(int &shield_ac) const -{ - int ac = itembonuses.AC + spellbonuses.AC; +int Client::GetRawACNoShield(int &shield_ac) const { + int ac = (itembonuses.AC + spellbonuses.AC); shield_ac = 0; const ItemInst *inst = m_inv.GetItem(SLOT_SECONDARY); - if(inst) - { - if(inst->GetItem()->ItemType == ItemTypeShield) - { + if(inst) { + if(inst->GetItem()->ItemType == ItemTypeShield) { ac -= inst->GetItem()->AC; shield_ac = inst->GetItem()->AC; - for(uint8 i = 0; i < MAX_AUGMENT_SLOTS; i++) - { - if(inst->GetAugment(i)) - { + for(uint8 i = 0; i < MAX_AUGMENT_SLOTS; i++) { + if(inst->GetAugment(i)) { ac -= inst->GetAugment(i)->GetItem()->AC; shield_ac += inst->GetAugment(i)->GetItem()->AC; } @@ -1987,4 +1530,4 @@ int Client::GetRawACNoShield(int &shield_ac) const } } return ac; -} +} \ No newline at end of file diff --git a/zone/client_packet.cpp b/zone/client_packet.cpp index 7320bbabb..ed99c509c 100644 --- a/zone/client_packet.cpp +++ b/zone/client_packet.cpp @@ -201,7 +201,7 @@ void MapOpcodes() { ConnectedOpcodes[OP_CombatAbility] = &Client::Handle_OP_CombatAbility; ConnectedOpcodes[OP_Taunt] = &Client::Handle_OP_Taunt; ConnectedOpcodes[OP_InstillDoubt] = &Client::Handle_OP_InstillDoubt; - ConnectedOpcodes[OP_RezzAnswer] = &Client::Handle_OP_RezzAnswer; + ConnectedOpcodes[OP_ResurrectionAnswer] = &Client::Handle_OP_ResurrectionAnswer; ConnectedOpcodes[OP_GMSummon] = &Client::Handle_OP_GMSummon; ConnectedOpcodes[OP_TradeRequest] = &Client::Handle_OP_TradeRequest; ConnectedOpcodes[OP_TradeRequestAck] = &Client::Handle_OP_TradeRequestAck; @@ -2506,7 +2506,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app) else Message(0, "This corpse will decay in %i minutes and %i seconds.", min, sec); - Message(0, "This corpse %s be resurrected.", tcorpse->Rezzed()?"cannot":"can"); + Message(0, "This corpse %s be resurrected.", tcorpse->isResurrected()?"cannot":"can"); /* hour = 0; @@ -4712,26 +4712,26 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app) return; } -void Client::Handle_OP_RezzAnswer(const EQApplicationPacket *app) +void Client::Handle_OP_ResurrectionAnswer(const EQApplicationPacket *app) { - VERIFY_PACKET_LENGTH(OP_RezzAnswer, app, Resurrect_Struct); + VERIFY_PACKET_LENGTH(OP_ResurrectionAnswer, app, Resurrect_Struct); const Resurrect_Struct* ra = (const Resurrect_Struct*) app->pBuffer; - _log(SPELLS__REZ, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", - PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); + _log(SPELLS__RESURRECTION, "Received OP_ResurrectionAnswer from client. PendingResurrectionexp is %i, action is %s", + PendingResurrectionXP, ra->action ? "ACCEPT" : "DECLINE"); - _pkt(SPELLS__REZ, app); + _pkt(SPELLS__RESURRECTION, app); - OPRezzAnswer(ra->action, ra->spellid, ra->zone_id, ra->instance_id, ra->x, ra->y, ra->z); + OPResurrectionAnswer(ra->action, ra->spellid, ra->zone_id, ra->instance_id, ra->x, ra->y, ra->z); if(ra->action == 1) { EQApplicationPacket* outapp = app->Copy(); - // Send the OP_RezzComplete to the world server. This finds it's way to the zone that - // the rezzed corpse is in to mark the corpse as rezzed. - outapp->SetOpcode(OP_RezzComplete); - worldserver.RezzPlayer(outapp, 0, 0, OP_RezzComplete); + // Send the OP_ResurrectionComplete to the world server. This finds it's way to the zone that + // the resurrected corpse is in to mark the corpse as resurrected. + outapp->SetOpcode(OP_ResurrectionComplete); + worldserver.ResurrectPlayer(outapp, 0, 0, OP_ResurrectionComplete); safe_delete(outapp); } return; @@ -11598,22 +11598,14 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) database.DoEscapeString(EscSearchString, gmscs->Name, strlen(gmscs->Name)); - if (database.RunQuery(Query, MakeAnyLenString(&Query, "select charname, zoneid, x, y, z, timeofdeath, rezzed, IsBurried from " - "player_corpses where charname like '%%%s%%' order by charname limit %i", - EscSearchString, MaxResults), errbuf, &Result)) - { - + if (database.RunQuery(Query, MakeAnyLenString(&Query, "select charname, zoneid, x, y, z, timeofdeath, isResurrected, isBuried from player_corpses where charname like '%%%s%%' order by charname limit %i", EscSearchString, MaxResults), errbuf, &Result)) { int NumberOfRows = mysql_num_rows(Result); - if(NumberOfRows == MaxResults) Message(clientMessageError, "Your search found too many results; some are not displayed."); - else { - Message(clientMessageYellow, "There are %i corpse(s) that match the search string '%s'.", - NumberOfRows, gmscs->Name); - } + else + Message(clientMessageYellow, "There are %i corpse(s) that match the search string '%s'.", NumberOfRows, gmscs->Name); - if(NumberOfRows == 0) - { + if(NumberOfRows == 0) { mysql_free_result(Result); safe_delete_array(Query); return; @@ -11621,51 +11613,31 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app) char CharName[64], TimeOfDeath[20], Buffer[512]; - std::string PopupText = ""; + std::string PopupText = "
NameZoneXYZDate" - "RezzedBuried
 " - "
"; - while ((Row = mysql_fetch_row(Result))) - { - + while ((Row = mysql_fetch_row(Result))) { strn0cpy(CharName, Row[0], sizeof(CharName)); - uint32 ZoneID = atoi(Row[1]); - float CorpseX = atof(Row[2]); float CorpseY = atof(Row[3]); float CorpseZ = atof(Row[4]); - strn0cpy(TimeOfDeath, Row[5], sizeof(TimeOfDeath)); - - bool CorpseRezzed = atoi(Row[6]); + bool CorpseResurrected = atoi(Row[6]); bool CorpseBuried = atoi(Row[7]); - - sprintf(Buffer, "", - CharName, StaticGetZoneName(ZoneID), CorpseX, CorpseY, CorpseZ, TimeOfDeath, - CorpseRezzed ? "Yes" : "No", CorpseBuried ? "Yes" : "No"); - + sprintf(Buffer, "", CharName, StaticGetZoneName(ZoneID), CorpseX, CorpseY, CorpseZ, TimeOfDeath, CorpseResurrected ? "Yes" : "No", CorpseBuried ? "Yes" : "No"); PopupText += Buffer; - - if(PopupText.size() > 4000) - { + if(PopupText.size() > 4000) { Message(clientMessageError, "Unable to display all the results."); break; } - } - PopupText += "
NameZoneXYZDateResurrectedBuried
 
%s%s%8.0f%8.0f%8.0f%s%s%s
%s%s%8.0f%8.0f%8.0f%s%s%s
"; - mysql_free_result(Result); - SendPopupToClient("Corpses", PopupText.c_str()); } - else{ + else Message(0, "Query failed: %s.", errbuf); - - } safe_delete_array(Query); safe_delete_array(EscSearchString); } diff --git a/zone/client_packet.h b/zone/client_packet.h index 22e8f92f4..b344ec101 100644 --- a/zone/client_packet.h +++ b/zone/client_packet.h @@ -103,7 +103,7 @@ void Handle_OP_CombatAbility(const EQApplicationPacket *app); void Handle_OP_Taunt(const EQApplicationPacket *app); void Handle_OP_InstillDoubt(const EQApplicationPacket *app); - void Handle_OP_RezzAnswer(const EQApplicationPacket *app); + void Handle_OP_ResurrectionAnswer(const EQApplicationPacket *app); void Handle_OP_GMSummon(const EQApplicationPacket *app); void Handle_OP_TradeRequest(const EQApplicationPacket *app); void Handle_OP_TradeRequestAck(const EQApplicationPacket *app); diff --git a/zone/client_process.cpp b/zone/client_process.cpp index f245c1d44..358385fc0 100644 --- a/zone/client_process.cpp +++ b/zone/client_process.cpp @@ -1125,43 +1125,43 @@ uint8 Client::WithCustomer(uint16 NewCustomer){ return 0; } -void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z) +void Client::OPResurrectionAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 InstanceID, float x, float y, float z) { - if(PendingRezzXP < 0) { - // pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer - _log(SPELLS__REZ, "Unexpected OP_RezzAnswer. Ignoring it."); + if(PendingResurrectionXP < 0) { + // pendingmRessurectionExp is set to -1 if we are not expecting an OP_ResurrectionAnswer + _log(SPELLS__RESURRECTION, "Unexpected OP_ResurrectionAnswer. Ignoring it."); Message(13, "You have already been resurrected.\n"); return; } if (Action == 1) { - // Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the - // corpse is in has shutdown since the rez spell was cast. - database.MarkCorpseAsRezzed(PendingRezzDBID); - _log(SPELLS__REZ, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", + // Mark the corpse as resurrected in the database, just in case the corpse has buried, or the zone the + // corpse is in has shutdown since the resurrection spell was cast. + database.MarkCorpseAsResurrected(PendingResurrectionDBID); + _log(SPELLS__RESURRECTION, "Player %s got a %i Resurrection, spellid %i in zone%i, instance id %i", this->name, (uint16)spells[SpellID].base[0], SpellID, ZoneID, InstanceID); this->BuffFadeNonPersistDeath(); int SpellEffectDescNum = GetSpellEffectDescNum(SpellID); - // Rez spells with Rez effects have this DescNum (first is Titanium, second is 6.2 Client) + // Resurrection spells with Resurrection effects have this DescNum (first is Titanium, second is 6.2 Client) if((SpellEffectDescNum == 82) || (SpellEffectDescNum == 39067)) { SetMana(0); SetHP(GetMaxHP()/5); - SpellOnTarget(756, this); // Rezz effects + SpellOnTarget(756, this); // Resurrection effects } else { SetMana(GetMaxMana()); SetHP(GetMaxHP()); } - if(spells[SpellID].base[0] < 100 && spells[SpellID].base[0] > 0 && PendingRezzXP > 0) + if(spells[SpellID].base[0] < 100 && spells[SpellID].base[0] > 0 && PendingResurrectionXP > 0) { - SetEXP(((int)(GetEXP()+((float)((PendingRezzXP / 100) * spells[SpellID].base[0])))), + SetEXP(((int)(GetEXP()+((float)((PendingResurrectionXP / 100) * spells[SpellID].base[0])))), GetAAXP(),true); } - else if (spells[SpellID].base[0] == 100 && PendingRezzXP > 0) { - SetEXP((GetEXP() + PendingRezzXP), GetAAXP(), true); + else if (spells[SpellID].base[0] == 100 && PendingResurrectionXP > 0) { + SetEXP((GetEXP() + PendingResurrectionXP), GetAAXP(), true); } //Was sending the packet back to initiate client zone... @@ -1169,8 +1169,8 @@ void Client::OPRezzAnswer(uint32 Action, uint32 SpellID, uint16 ZoneID, uint16 I MovePC(ZoneID, InstanceID, x, y, z, GetHeading(), 0, ZoneSolicited); entity_list.RefreshClientXTargets(this); } - PendingRezzXP = -1; - PendingRezzSpellID = 0; + PendingResurrectionXP = -1; + PendingResurrectionSpellID = 0; } void Client::OPTGB(const EQApplicationPacket *app) @@ -2043,7 +2043,7 @@ void Client::HandleRespawnFromHover(uint32 Option) RespawnFromHoverTimer.Disable(); RespawnOption* chosen = nullptr; - bool is_rez = false; + bool is_resurrected = false; //Find the selected option if (Option == 0) @@ -2053,7 +2053,7 @@ void Client::HandleRespawnFromHover(uint32 Option) else if (Option == (respawn_options.size() - 1)) { chosen = &respawn_options.back(); - is_rez = true; //Rez must always be the last option + is_resurrected = true; //Resurrection must always be the last option } else { @@ -2083,21 +2083,21 @@ void Client::HandleRespawnFromHover(uint32 Option) default_to_bind->z = b->z; default_to_bind->heading = b->heading; chosen = default_to_bind; - is_rez = false; + is_resurrected = false; } if (chosen->zoneid == zone->GetZoneID()) //If they should respawn in the current zone... { - if (is_rez) + if (is_resurrected) { - if (PendingRezzXP < 0 || PendingRezzSpellID == 0) + if (PendingResurrectionXP < 0 || PendingResurrectionSpellID == 0) { - _log(SPELLS__REZ, "Unexpected Rezz from hover request."); + _log(SPELLS__RESURRECTION, "Unexpected Resurrection from hover request."); return; } SetHP(GetMaxHP() / 5); - Corpse* corpse = entity_list.GetCorpseByName(PendingRezzCorpseName.c_str()); + Corpse* corpse = entity_list.GetCorpseByName(PendingResurrectionCorpseName.c_str()); if (corpse) { @@ -2121,22 +2121,22 @@ void Client::HandleRespawnFromHover(uint32 Option) ClearHover(); SendHPUpdate(); - OPRezzAnswer(1, PendingRezzSpellID, zone->GetZoneID(), zone->GetInstanceID(), GetX(), GetY(), GetZ()); + OPResurrectionAnswer(1, PendingResurrectionSpellID, zone->GetZoneID(), zone->GetInstanceID(), GetX(), GetY(), GetZ()); if (corpse && corpse->IsCorpse()) { - _log(SPELLS__REZ, "Hover Rez in zone %s for corpse %s", - zone->GetShortName(), PendingRezzCorpseName.c_str()); + _log(SPELLS__RESURRECTION, "Hover Resurrection in zone %s for corpse %s", + zone->GetShortName(), PendingResurrectionCorpseName.c_str()); - _log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); + _log(SPELLS__RESURRECTION, "Found corpse. Marking corpse as resurrected."); - corpse->Rezzed(true); - corpse->CompleteRezz(); + corpse->setResurrected(true); + corpse->CompleteResurrection(); } } - else //Not rez + else //Not resurrected { - PendingRezzSpellID = 0; + PendingResurrectionSpellID = 0; EQApplicationPacket* outapp = new EQApplicationPacket(OP_ZonePlayerToBind, sizeof(ZonePlayerToBind_Struct) + chosen->name.length() + 1); ZonePlayerToBind_Struct* gmg = (ZonePlayerToBind_Struct*) outapp->pBuffer; @@ -2166,9 +2166,9 @@ void Client::HandleRespawnFromHover(uint32 Option) } //After they've respawned into the same zone, trigger EVENT_RESPAWN - parse->EventPlayer(EVENT_RESPAWN, this, static_cast(itoa(Option)), is_rez ? 1 : 0); + parse->EventPlayer(EVENT_RESPAWN, this, static_cast(itoa(Option)), is_resurrected ? 1 : 0); - //Pop Rez option from the respawn options list; + //Pop Resurrection option from the respawn options list; //easiest way to make sure it stays at the end and //doesn't disrupt adding/removing scripted options respawn_options.pop_back(); diff --git a/zone/command.cpp b/zone/command.cpp index e7852ad47..7842ed3e8 100644 --- a/zone/command.cpp +++ b/zone/command.cpp @@ -410,8 +410,8 @@ int command_init(void) { command_add("traindisc","[level] - Trains all the disciplines usable by the target, up to level specified. (may freeze client for a few seconds)",150,command_traindisc) || command_add("setgraveyard","[zone name] - Creates a graveyard for the specified zone based on your target's LOC.", 200, command_setgraveyard) || command_add("deletegraveyard","[zone name] - Deletes the graveyard for the specified zone.", 200, command_deletegraveyard) || - command_add("getplayerburriedcorpsecount","- Get the target's total number of burried player corpses.", 100, command_getplayerburriedcorpsecount) || - command_add("summonburriedplayercorpse","- Summons the target's oldest burried corpse, if any exist.", 100, command_summonburriedplayercorpse) || + command_add("getplayerburiedcorpsecount","- Get the target's total number of buried player corpses.", 100, command_getplayerburiedcorpsecount) || + command_add("summonburiedplayercorpse","- Summons the target's oldest buried corpse, if any exist.", 100, command_summonburiedplayercorpse) || command_add("refreshgroup","- Refreshes Group.", 0, command_refreshgroup) || command_add("advnpcspawn","[maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]",150,command_advnpcspawn) || command_add("advnpc","analog for advnpcspawn [maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]",150,command_advnpcspawn) || @@ -702,18 +702,18 @@ void command_resetaa(Client* c,const Seperator *sep){ void command_sendop(Client *c,const Seperator *sep){ - int RezSpell = 0; + int ResurrectionSpell = 0; if(sep->arg[1][0]) { - RezSpell = atoi(sep->arg[1]); + ResurrectionSpell = atoi(sep->arg[1]); } - EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); + EQApplicationPacket* outapp = new EQApplicationPacket(OP_ResurrectionRequest, sizeof(Resurrect_Struct)); Resurrect_Struct *rs = (Resurrect_Struct*)outapp->pBuffer; strcpy(rs->your_name, c->GetName()); - strcpy(rs->rezzer_name, "A Cleric01"); - rs->spellid = RezSpell; + strcpy(rs->resurrecter_name, "A Cleric01"); + rs->spellid = ResurrectionSpell; DumpPacket(outapp); c->QueuePacket(outapp); safe_delete(outapp); @@ -1062,7 +1062,7 @@ void command_npcloot(Client *c, const Seperator *sep) if (c->GetTarget()->IsNPC()) c->GetTarget()->CastToNPC()->QueryLoot(c); else if (c->GetTarget()->IsCorpse()) - c->GetTarget()->CastToCorpse()->QueryLoot(c); + c->GetTarget()->CastToCorpse()->queryLoot(c); else c->Message(0, "Error: Target's type doesnt have loot"); } @@ -3669,7 +3669,7 @@ void command_corpse(Client *c, const Seperator *sep) else if (!sep->IsNumber(2)) c->Message(0, "Error: charid must be a number."); else - c->Message(0, "Setting CharID=%u on PlayerCorpse '%s'", target->CastToCorpse()->SetCharID(atoi(sep->arg[2])), target->GetName()); + c->Message(0, "Setting CharID=%u on PlayerCorpse '%s'", target->CastToCorpse()->setCharacterID(atoi(sep->arg[2])), target->GetName()); } else if (strcasecmp(sep->arg[1], "ResetLooter") == 0) { if (target == 0 || !target->IsCorpse()) @@ -3677,12 +3677,12 @@ void command_corpse(Client *c, const Seperator *sep) else target->CastToCorpse()->ResetLooter(); } - else if (strcasecmp(sep->arg[1], "RemoveCash") == 0) { + else if (strcasecmp(sep->arg[1], "removeCash") == 0) { if (target == 0 || !target->IsCorpse()) c->Message(0, "Error: Target the corpse you wish to remove the cash from"); else if (!target->IsPlayerCorpse() || c->Admin() >= commandEditPlayerCorpses) { c->Message(0, "Removing Cash from %s.", target->GetName()); - target->CastToCorpse()->RemoveCash(); + target->CastToCorpse()->removeCash(); } else c->Message(0, "Insufficient status to modify player corpse."); @@ -3691,13 +3691,13 @@ void command_corpse(Client *c, const Seperator *sep) if (target == 0 || !target->IsCorpse()) c->Message(0, "Error: Target must be a corpse."); else - target->CastToCorpse()->QueryLoot(c); + target->CastToCorpse()->queryLoot(c); } else if (strcasecmp(sep->arg[1], "lock") == 0) { if (target == 0 || !target->IsCorpse()) c->Message(0, "Error: Target must be a corpse."); else { - target->CastToCorpse()->Lock(); + target->CastToCorpse()->lock(); c->Message(0, "Locking %s...", target->GetName()); } } @@ -3705,7 +3705,7 @@ void command_corpse(Client *c, const Seperator *sep) if (target == 0 || !target->IsCorpse()) c->Message(0, "Error: Target must be a corpse."); else { - target->CastToCorpse()->UnLock(); + target->CastToCorpse()->unlock(); c->Message(0, "Unlocking %s...", target->GetName()); } } @@ -3741,8 +3741,8 @@ void command_corpse(Client *c, const Seperator *sep) c->Message(0, " ListNPC"); c->Message(0, " ListPlayer"); c->Message(0, " Lock - GM locks the corpse - cannot be looted by non-GM"); - c->Message(0, " UnLock"); - c->Message(0, " RemoveCash"); + c->Message(0, " Unlock"); + c->Message(0, " removeCash"); c->Message(0, " InspectLoot"); c->Message(0, " [to remove items from corpses, loot them]"); c->Message(0, "Lead-GM status required to delete/modify player corpses"); @@ -8783,7 +8783,7 @@ void command_deletegraveyard(Client *c, const Seperator *sep) return; } -void command_summonburriedplayercorpse(Client *c, const Seperator *sep) +void command_summonburiedplayercorpse(Client *c, const Seperator *sep) { Client *t=c; @@ -8794,15 +8794,15 @@ void command_summonburriedplayercorpse(Client *c, const Seperator *sep) return; } - Corpse* PlayerCorpse = database.SummonBurriedPlayerCorpse(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetX(), t->GetY(), t->GetZ(), t->GetHeading()); + Corpse* PlayerCorpse = database.SummonBuriedPlayerCorpse(t->CharacterID(), t->GetZoneID(), zone->GetInstanceID(), t->GetX(), t->GetY(), t->GetZ(), t->GetHeading()); if(!PlayerCorpse) - c->Message(0, "Your target doesn't have any burried corpses."); + c->Message(0, "Your target doesn't have any buried corpses."); return; } -void command_getplayerburriedcorpsecount(Client *c, const Seperator *sep) +void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep) { Client *t=c; @@ -8813,12 +8813,12 @@ void command_getplayerburriedcorpsecount(Client *c, const Seperator *sep) return; } - uint32 CorpseCount = database.GetPlayerBurriedCorpseCount(t->CharacterID()); + uint32 CorpseCount = database.GetPlayerBuriedCorpseCount(t->CharacterID()); if(CorpseCount > 0) - c->Message(0, "Your target has a total of %u burried corpses.", CorpseCount); + c->Message(0, "Your target has a total of %u buried corpses.", CorpseCount); else - c->Message(0, "Your target doesn't have any burried corpses."); + c->Message(0, "Your target doesn't have any buried corpses."); return; } diff --git a/zone/command.h b/zone/command.h index f3eb39a5d..36ff4695e 100644 --- a/zone/command.h +++ b/zone/command.h @@ -286,8 +286,8 @@ void command_refundaa(Client *c, const Seperator *sep); void command_traindisc(Client *c, const Seperator *sep); void command_deletegraveyard(Client *c, const Seperator *sep); void command_setgraveyard(Client *c, const Seperator *sep); -void command_getplayerburriedcorpsecount(Client *c, const Seperator *sep); -void command_summonburriedplayercorpse(Client *c, const Seperator *sep); +void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep); +void command_summonburiedplayercorpse(Client *c, const Seperator *sep); void command_unscribespell(Client *c, const Seperator *sep); void command_scribespell(Client *c, const Seperator *sep); void command_refreshgroup(Client *c, const Seperator *sep); diff --git a/zone/common.h b/zone/common.h index d2737e4a5..26c095fe9 100644 --- a/zone/common.h +++ b/zone/common.h @@ -11,8 +11,8 @@ #define _CLIENT(x) (x && x->IsClient() && !x->CastToClient()->IsBecomeNPC()) #define _NPC(x) (x && x->IsNPC() && !x->CastToMob()->GetOwnerID()) #define _BECOMENPC(x) (x && x->IsClient() && x->CastToClient()->IsBecomeNPC()) -#define _CLIENTCORPSE(x) (x && x->IsCorpse() && x->CastToCorpse()->IsPlayerCorpse() && !x->CastToCorpse()->IsBecomeNPCCorpse()) -#define _NPCCORPSE(x) (x && x->IsCorpse() && (x->CastToCorpse()->IsNPCCorpse() || x->CastToCorpse()->IsBecomeNPCCorpse())) +#define _CLIENTCORPSE(x) (x && x->IsCorpse() && x->CastToCorpse()->IsPlayerCorpse()) +#define _NPCCORPSE(x) (x && x->IsCorpse() && (x->CastToCorpse()->IsNPCCorpse())) #define _CLIENTPET(x) (x && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsClient()) #define _NPCPET(x) (x && x->IsNPC() && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsNPC()) #define _BECOMENPCPET(x) (x && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsClient() && x->CastToMob()->GetOwner()->CastToClient()->IsBecomeNPC()) diff --git a/zone/corpse.cpp b/zone/corpse.cpp index 992649c03..2e8df83ec 100644 --- a/zone/corpse.cpp +++ b/zone/corpse.cpp @@ -63,7 +63,7 @@ void Corpse::SendLootReqErrorPacket(Client* client, uint8 response) { safe_delete(outapp); } -Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charname, uchar* in_data, uint32 in_datasize, float in_x, float in_y, float in_z, float in_heading, char* timeofdeath, bool rezzed, bool wasAtGraveyard) { +Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charname, uchar* in_data, uint32 in_datasize, float in_x, float in_y, float in_z, float in_heading, char* timeofdeath, bool isResurrected, bool wasAtGraveyard) { if (in_datasize < sizeof(classic_db::DBPlayerCorpse_Struct)) { LogFile->write(EQEMuLog::Error, "Corpse::LoadFromDBData: Corrupt data: in_datasize < sizeof(DBPlayerCorpse_Struct)"); return 0; @@ -117,10 +117,10 @@ Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charna Corpse* pc = new Corpse(in_dbid, in_charid, in_charname, &itemlist, dbpcs->copper, dbpcs->silver, dbpcs->gold, dbpcs->plat, in_x, in_y, in_z, in_heading, dbpcs->size, dbpcs->gender, RealRace, dbpcs->class_, dbpcs->deity, dbpcs->level, dbpcs->texture, dbpcs->helmtexture, dbpcs->exp, wasAtGraveyard); if (dbpcs->locked) - pc->Lock(); + pc->lock(); // load tints - memcpy(pc->item_tint, dbpcs->item_tint, sizeof(pc->item_tint)); + memcpy(pc->mItemTints, dbpcs->item_tint, sizeof(pc->mItemTints)); // appearance pc->haircolor = dbpcs->haircolor; pc->beardcolor = dbpcs->beardcolor; @@ -132,8 +132,7 @@ Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charna pc->drakkin_heritage = dbpcs->drakkin_heritage; pc->drakkin_tattoo = dbpcs->drakkin_tattoo; pc->drakkin_details = dbpcs->drakkin_details; - pc->Rezzed(rezzed); - pc->become_npc = false; + pc->setResurrected(isResurrected); return pc; } else @@ -167,10 +166,10 @@ Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charna Corpse* pc = new Corpse(in_dbid, in_charid, in_charname, &itemlist, dbpc->copper, dbpc->silver, dbpc->gold, dbpc->plat, in_x, in_y, in_z, in_heading, dbpc->size, dbpc->gender, RealRace, dbpc->class_, dbpc->deity, dbpc->level, dbpc->texture, dbpc->helmtexture,dbpc->exp, wasAtGraveyard); if (dbpc->locked) - pc->Lock(); + pc->lock(); // load tints - memcpy(pc->item_tint, dbpc->item_tint, sizeof(pc->item_tint)); + memcpy(pc->mItemTints, dbpc->item_tint, sizeof(pc->mItemTints)); // appearance pc->haircolor = dbpc->haircolor; pc->beardcolor = dbpc->beardcolor; @@ -182,8 +181,7 @@ Corpse* Corpse::LoadFromDBData(uint32 in_dbid, uint32 in_charid, char* in_charna pc->drakkin_heritage = 0; pc->drakkin_tattoo = 0; pc->drakkin_details = 0; - pc->Rezzed(rezzed); - pc->become_npc = false; + pc->setResurrected(isResurrected); return pc; } } @@ -198,58 +196,58 @@ Corpse::Corpse(NPC* in_npc, ItemList* in_itemlist, uint32 in_npctypeid, const NP in_npc->GetTexture(),in_npc->GetHelmTexture(), 0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0xff,0,0,0,0,0,0,0,0,0), - corpse_decay_timer(in_decaytime), - corpse_res_timer(0), - corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)), - corpse_graveyard_timer(0), - loot_cooldown_timer(10) + mDecayTimer(in_decaytime), + mResurrectionTimer(0), + mLockoutTimer(RuleI(NPC, CorpseUnlockTimer)), + mGraveyardTimer(0), + mCoolDownTimer(10) { - corpse_graveyard_timer.Disable(); - memset(item_tint, 0, sizeof(item_tint)); - pIsChanged = false; - p_PlayerCorpse = false; - pLocked = false; - BeingLootedBy = 0xFFFFFFFF; + mGraveyardTimer.Disable(); + memset(mItemTints, 0, sizeof(mItemTints)); + mChanged = false; + mPlayerCorpse = false; + mLocked = false; + mBeingLootedBy = 0xFFFFFFFF; if (in_itemlist) { - itemlist = *in_itemlist; + mItems = *in_itemlist; in_itemlist->clear(); } - SetCash(in_npc->GetCopper(), in_npc->GetSilver(), in_npc->GetGold(), in_npc->GetPlatinum()); + setCash(in_npc->GetCopper(), in_npc->GetSilver(), in_npc->GetGold(), in_npc->GetPlatinum()); npctype_id = in_npctypeid; - SetPKItem(0); - charid = 0; - dbid = 0; - p_depop = false; + setPKItem(0); + mCharacterID = 0; + mDBID = 0; + mDespawnRequested = false; strcpy(orgname, in_npc->GetName()); strcpy(name, in_npc->GetName()); // Added By Hogie for(int count = 0; count < 100; count++) { if ((level >= npcCorpseDecayTimes[count].minlvl) && (level <= npcCorpseDecayTimes[count].maxlvl)) { - corpse_decay_timer.SetTimer(npcCorpseDecayTimes[count].seconds*1000); + mDecayTimer.SetTimer(npcCorpseDecayTimes[count].seconds*1000); break; } } if(IsEmpty()) { - corpse_decay_timer.SetTimer(RuleI(NPC,EmptyNPCCorpseDecayTimeMS)+1000); + mDecayTimer.SetTimer(RuleI(NPC,EmptyNPCCorpseDecayTimeMS)+1000); } if(in_npc->HasPrivateCorpse()) { - corpse_delay_timer.SetTimer(corpse_decay_timer.GetRemainingTime() + 1000); + mLockoutTimer.SetTimer(mDecayTimer.GetRemainingTime() + 1000); } // Added By Hogie -- End for (int i=0; irezzexp = 0; + mLooters[i] = 0; + this->mResurrectionExp = 0; } // To be used on PC death // Mongrel: added see_invis and see_invis_undead -Corpse::Corpse(Client* client, int32 in_rezexp) +Corpse::Corpse(Client* client, int32 in_mRessurectionExp) // vesuvias - appearence fix : Mob ( @@ -304,51 +302,47 @@ Corpse::Corpse(Client* client, int32 in_rezexp) 0, // maxlevel 0 // scalerate ), - corpse_decay_timer(RuleI(Character, CorpseDecayTimeMS)), - corpse_res_timer(RuleI(Character, CorpseResTimeMS)), - corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)), - corpse_graveyard_timer(RuleI(Zone, GraveyardTimeMS)), - loot_cooldown_timer(10) + mDecayTimer(RuleI(Character, CorpseDecayTimeMS)), + mResurrectionTimer(RuleI(Character, CorpseResTimeMS)), + mLockoutTimer(RuleI(NPC, CorpseUnlockTimer)), + mGraveyardTimer(RuleI(Zone, GraveyardTimeMS)), + mCoolDownTimer(10) { int i; PlayerProfile_Struct *pp = &client->GetPP(); ItemInst *item; if(!zone->HasGraveyard()) { - corpse_graveyard_timer.Disable(); + mGraveyardTimer.Disable(); } - memset(item_tint, 0, sizeof(item_tint)); + memset(mItemTints, 0, sizeof(mItemTints)); for (i=0; iCharacterID(); - dbid = 0; - p_depop = false; - copper = 0; - silver = 0; - gold = 0; - platinum = 0; + mChanged = true; + mResurrectionExp = in_mRessurectionExp; + mPlayerCorpse = true; + mLocked = false; + mBeingLootedBy = 0xFFFFFFFF; + mCharacterID = client->CharacterID(); + mDBID = 0; + mDespawnRequested = false; + mCopper = 0; + mSilver = 0; + mGold = 0; + mPlatinum = 0; strcpy(orgname, pp->name); strcpy(name, pp->name); - //become_npc was not being initialized which led to some pretty funky things with newly created corpses - become_npc = false; - - SetPKItem(0); + setPKItem(0); if(!RuleB(Character, LeaveNakedCorpses) || RuleB(Character, LeaveCorpses) && GetLevel() >= RuleI(Character, DeathItemLossLevel)) { // cash // Let's not move the cash when 'RespawnFromHover = true' && 'client->GetClientVersion() < EQClientSoF' since the client doesn't. // (change to first client that supports 'death hover' mode, if not SoF.) if (!RuleB(Character, RespawnFromHover) || client->GetClientVersion() < EQClientSoF) { - SetCash(pp->copper, pp->silver, pp->gold, pp->platinum); + setCash(pp->copper, pp->silver, pp->gold, pp->platinum); pp->copper = 0; pp->silver = 0; pp->gold = 0; @@ -356,7 +350,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) } // get their tints - memcpy(item_tint, &client->GetPP().item_tint, sizeof(item_tint)); + memcpy(mItemTints, &client->GetPP().item_tint, sizeof(mItemTints)); // solar: TODO soulbound items need not be added to corpse, but they need // to go into the regular slots on the player, out of bags @@ -433,7 +427,7 @@ Corpse::Corpse(Client* client, int32 in_rezexp) client->Save(); } //end "not leaving naked corpses" - Rezzed(false); + setResurrected(false); Save(); } @@ -471,59 +465,59 @@ std::list Corpse::MoveItemToCorpse(Client *client, ItemInst *item, int16 // To be called from LoadFromDBData // Mongrel: added see_invis and see_invis_undead -Corpse::Corpse(uint32 in_dbid, uint32 in_charid, char* in_charname, ItemList* in_itemlist, uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_plat, float in_x, float in_y, float in_z, float in_heading, float in_size, uint8 in_gender, uint16 in_race, uint8 in_class, uint8 in_deity, uint8 in_level, uint8 in_texture, uint8 in_helmtexture,uint32 in_rezexp, bool wasAtGraveyard) +Corpse::Corpse(uint32 in_dbid, uint32 in_charid, char* in_charname, ItemList* in_itemlist, uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_plat, float in_x, float in_y, float in_z, float in_heading, float in_size, uint8 in_gender, uint16 in_race, uint8 in_class, uint8 in_deity, uint8 in_level, uint8 in_texture, uint8 in_helmtexture,uint32 in_mRessurectionExp, bool wasAtGraveyard) : Mob("Unnamed_Corpse","",0,0,in_gender, in_race, in_class, BT_Humanoid, in_deity, in_level,0, in_size, 0, in_heading, in_x, in_y, in_z,0,in_texture,in_helmtexture, 0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0xff, 0,0,0,0,0,0,0,0,0), - corpse_decay_timer(RuleI(Character, CorpseDecayTimeMS)), - corpse_res_timer(RuleI(Character, CorpseResTimeMS)), - corpse_delay_timer(RuleI(NPC, CorpseUnlockTimer)), - corpse_graveyard_timer(RuleI(Zone, GraveyardTimeMS)), - loot_cooldown_timer(10) + mDecayTimer(RuleI(Character, CorpseDecayTimeMS)), + mResurrectionTimer(RuleI(Character, CorpseResTimeMS)), + mLockoutTimer(RuleI(NPC, CorpseUnlockTimer)), + mGraveyardTimer(RuleI(Zone, GraveyardTimeMS)), + mCoolDownTimer(10) { //we really should be loading the decay timer here... LoadPlayerCorpseDecayTime(in_dbid); if(!zone->HasGraveyard() || wasAtGraveyard) - corpse_graveyard_timer.Disable(); + mGraveyardTimer.Disable(); - memset(item_tint, 0, sizeof(item_tint)); - pIsChanged = false; - p_PlayerCorpse = true; - pLocked = false; - BeingLootedBy = 0xFFFFFFFF; - dbid = in_dbid; - p_depop = false; - charid = in_charid; - itemlist = *in_itemlist; + memset(mItemTints, 0, sizeof(mItemTints)); + mChanged = false; + mPlayerCorpse = true; + mLocked = false; + mBeingLootedBy = 0xFFFFFFFF; + mDBID = in_dbid; + mDespawnRequested = false; + mCharacterID = in_charid; + mItems = *in_itemlist; in_itemlist->clear(); strcpy(orgname, in_charname); strcpy(name, in_charname); - this->copper = in_copper; - this->silver = in_silver; - this->gold = in_gold; - this->platinum = in_plat; - rezzexp = in_rezexp; + this->mCopper = in_copper; + this->mSilver = in_silver; + this->mGold = in_gold; + this->mPlatinum = in_plat; + mResurrectionExp = in_mRessurectionExp; for (int i=0; iCountItems(); + uint32 tmp = this->getNumItems(); uint32 tmpsize = sizeof(DBPlayerCorpse_Struct) + (tmp * sizeof(player_lootitem::ServerLootItem_Struct)); DBPlayerCorpse_Struct* dbpc = (DBPlayerCorpse_Struct*) new uchar[tmpsize]; memset(dbpc, 0, tmpsize); dbpc->itemcount = tmp; dbpc->size = this->size; - dbpc->locked = pLocked; - dbpc->copper = this->copper; - dbpc->silver = this->silver; - dbpc->gold = this->gold; - dbpc->plat = this->platinum; + dbpc->locked = mLocked; + dbpc->copper = this->mCopper; + dbpc->silver = this->mSilver; + dbpc->gold = this->mGold; + dbpc->plat = this->mPlatinum; // Little hack to account for the fact the race in the corpse struct is a uint8 and Froglok/Drakkin race number > 255 // and to maintain backwards compatability with existing corpses in the database. @@ -581,9 +575,9 @@ bool Corpse::Save() { dbpc->level = level; dbpc->texture = this->texture; dbpc->helmtexture = this->helmtexture; - dbpc->exp = rezzexp; + dbpc->exp = mResurrectionExp; - memcpy(dbpc->item_tint, item_tint, sizeof(dbpc->item_tint)); + memcpy(dbpc->item_tint, mItemTints, sizeof(dbpc->item_tint)); dbpc->haircolor = haircolor; dbpc->beardcolor = beardcolor; dbpc->eyecolor2 = eyecolor1; @@ -596,8 +590,8 @@ bool Corpse::Save() { uint32 x = 0; ItemList::iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { ServerLootItem_Struct* item = *cur; memcpy((char*) &dbpc->items[x++], (char*) item, sizeof(player_lootitem::ServerLootItem_Struct)); @@ -605,16 +599,16 @@ bool Corpse::Save() { dbpc->crc = CRC32::Generate(&((uchar*) dbpc)[4], tmpsize - 4); - if (dbid == 0) + if (mDBID == 0) { - dbid = database.CreatePlayerCorpse(charid, orgname, zone->GetZoneID(), zone->GetInstanceID(), (uchar*) dbpc, tmpsize, x_pos, y_pos, z_pos, heading); + mDBID = database.CreatePlayerCorpse(mCharacterID, orgname, zone->GetZoneID(), zone->GetInstanceID(), (uchar*) dbpc, tmpsize, x_pos, y_pos, z_pos, heading); if(RuleB(Zone, UsePlayerCorpseBackups) == true) - database.CreatePlayerCorpseBackup(dbid, charid, orgname, zone->GetZoneID(), zone->GetInstanceID(), (uchar*) dbpc, tmpsize, x_pos, y_pos, z_pos, heading); + database.CreatePlayerCorpseBackup(mDBID, mCharacterID, orgname, zone->GetZoneID(), zone->GetInstanceID(), (uchar*) dbpc, tmpsize, x_pos, y_pos, z_pos, heading); } else - dbid = database.UpdatePlayerCorpse(dbid, charid, orgname, zone->GetZoneID(), zone->GetInstanceID(), (uchar*) dbpc, tmpsize, x_pos, y_pos, z_pos, heading,Rezzed()); + mDBID = database.UpdatePlayerCorpse(mDBID, mCharacterID, orgname, zone->GetZoneID(), zone->GetInstanceID(), (uchar*) dbpc, tmpsize, x_pos, y_pos, z_pos, heading,isResurrected()); safe_delete_array(dbpc); - if (dbid == 0) { + if (mDBID == 0) { std::cout << "Error: Failed to save player corpse '" << this->GetName() << "'" << std::endl; return false; } @@ -622,38 +616,38 @@ bool Corpse::Save() { } void Corpse::Delete() { - if (IsPlayerCorpse() && dbid != 0) - database.DeletePlayerCorpse(dbid); - dbid = 0; + if (IsPlayerCorpse() && mDBID != 0) + database.DeletePlayerCorpse(mDBID); + mDBID = 0; - p_depop = true; + mDespawnRequested = true; } void Corpse::Bury() { - if (IsPlayerCorpse() && dbid != 0) - database.BuryPlayerCorpse(dbid); - dbid = 0; + if (IsPlayerCorpse() && mDBID != 0) + database.BuryPlayerCorpse(mDBID); + mDBID = 0; - p_depop = true; + mDespawnRequested = true; } void Corpse::Depop() { if (IsNPCCorpse()) - p_depop = true; + mDespawnRequested = true; } void Corpse::DepopCorpse() { - p_depop = true; + mDespawnRequested = true; } -uint32 Corpse::CountItems() { - return itemlist.size(); +uint32 Corpse::getNumItems() { + return mItems.size(); } void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) { if (!database.GetItem(itemnum)) return; - pIsChanged = true; + mChanged = true; ServerLootItem_Struct* item = new ServerLootItem_Struct; memset(item, 0, sizeof(ServerLootItem_Struct)); item->item_id = itemnum; @@ -664,7 +658,7 @@ void Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, ui item->aug3=aug3; item->aug4=aug4; item->aug5=aug5; - itemlist.push_back(item); + mItems.push_back(item); } ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct** bag_item_data) @@ -673,8 +667,8 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct** // find the item ItemList::iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { if((*cur)->lootslot == lootslot) { @@ -687,8 +681,8 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct** { int16 bagstart = Inventory::CalcSlotId(sitem->equipSlot, 0); - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { sitem2 = *cur; if(sitem2->equipSlot >= bagstart && sitem2->equipSlot < bagstart + 10) @@ -703,8 +697,8 @@ ServerLootItem_Struct* Corpse::GetItem(uint16 lootslot, ServerLootItem_Struct** uint32 Corpse::GetWornItem(int16 equipSlot) const { ItemList::const_iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { ServerLootItem_Struct* item = *cur; if (item->equipSlot == equipSlot) @@ -723,8 +717,8 @@ void Corpse::RemoveItem(uint16 lootslot) return; ItemList::iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { ServerLootItem_Struct* sitem = *cur; if (sitem->lootslot == lootslot) @@ -740,14 +734,14 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data) uint8 material; ItemList::iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { ServerLootItem_Struct* sitem = *cur; if (sitem == item_data) { - pIsChanged = true; - itemlist.erase(cur); + mChanged = true; + mItems.erase(cur); material = Inventory::CalcMaterialFromSlot(sitem->equipSlot); if(material != 0xFF) @@ -760,76 +754,76 @@ void Corpse::RemoveItem(ServerLootItem_Struct* item_data) } } -void Corpse::SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum) { - this->copper = in_copper; - this->silver = in_silver; - this->gold = in_gold; - this->platinum = in_platinum; - pIsChanged = true; +void Corpse::setCash(uint32 pCopper, uint32 pSilver, uint32 pGold, uint32 pPlatinum) { + this->mCopper = pCopper; + this->mSilver = pSilver; + this->mGold = pGold; + this->mPlatinum = pPlatinum; + mChanged = true; } -void Corpse::RemoveCash() { - this->copper = 0; - this->silver = 0; - this->gold = 0; - this->platinum = 0; - pIsChanged = true; +void Corpse::removeCash() { + this->mCopper = 0; + this->mSilver = 0; + this->mGold = 0; + this->mPlatinum = 0; + mChanged = true; } bool Corpse::IsEmpty() const { - if (copper != 0 || silver != 0 || gold != 0 || platinum != 0) + if (mCopper != 0 || mSilver != 0 || mGold != 0 || mPlatinum != 0) return false; - return(itemlist.size() == 0); + return mItems.size() == 0; } bool Corpse::Process() { - if (p_depop) + if (mDespawnRequested) return false; - if(corpse_delay_timer.Check()) + if(mLockoutTimer.Check()) { for (int i=0; iHasGraveyard()) { Save(); - p_depop = true; - database.GraveyardPlayerCorpse(dbid, zone->graveyard_zoneid(), + mDespawnRequested = true; + database.GraveyardPlayerCorpse(mDBID, zone->graveyard_zoneid(), (zone->GetZoneID() == zone->graveyard_zoneid()) ? zone->GetInstanceID() : 0, zone->graveyard_x(), zone->graveyard_y(), zone->graveyard_z(), zone->graveyard_heading()); - corpse_graveyard_timer.Disable(); + mGraveyardTimer.Disable(); ServerPacket* pack = new ServerPacket(ServerOP_SpawnPlayerCorpse, sizeof(SpawnPlayerCorpse_Struct)); SpawnPlayerCorpse_Struct* spc = (SpawnPlayerCorpse_Struct*)pack->pBuffer; - spc->player_corpse_id = dbid; + spc->player_corpse_id = mDBID; spc->zone_id = zone->graveyard_zoneid(); worldserver.SendPacket(pack); safe_delete(pack); LogFile->write(EQEMuLog::Debug, "Moved %s player corpse to the designated graveyard in zone %s.", this->GetName(), database.GetZoneName(zone->graveyard_zoneid())); - dbid = 0; + mDBID = 0; } - corpse_graveyard_timer.Disable(); + mGraveyardTimer.Disable(); return false; } /* if(corpse_res_timer.Check()) { - can_rez = false; + can_resurrect = false; corpse_res_timer.Disable(); } */ - if(corpse_decay_timer.Check()) { + if(mDecayTimer.Check()) { if(!RuleB(Zone, EnableShadowrest)) Delete(); else { - if(database.BuryPlayerCorpse(dbid)) { + if(database.BuryPlayerCorpse(mDBID)) { Save(); - p_depop = true; - dbid = 0; - LogFile->write(EQEMuLog::Debug, "Tagged %s player corpse has burried.", this->GetName()); + mDespawnRequested = true; + mDBID = 0; + LogFile->write(EQEMuLog::Debug, "Tagged %s player corpse has buried.", this->GetName()); } else { @@ -837,7 +831,7 @@ bool Corpse::Process() { return true; } } - corpse_decay_timer.Disable(); + mDecayTimer.Disable(); return false; } @@ -846,84 +840,81 @@ bool Corpse::Process() { void Corpse::SetDecayTimer(uint32 decaytime) { if (decaytime == 0) - corpse_decay_timer.Trigger(); + mDecayTimer.Trigger(); else - corpse_decay_timer.Start(decaytime); + mDecayTimer.Start(decaytime); } -bool Corpse::CanMobLoot(int charid) { - uint8 z=0; - for(int i=0; i= MAX_LOOTERS) + if (pSlot >= MAX_LOOTERS) return; - if(them == nullptr || !them->IsClient()) + if (pCharacter == nullptr || !pCharacter->IsClient()) return; - looters[slot] = them->CastToClient()->CharacterID(); + mLooters[pSlot] = pCharacter->CastToClient()->CharacterID(); } // @merth: this function needs some work void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* app) { // Added 12/08. Started compressing loot struct on live. char tmp[10]; - if(p_depop) { + if(mDespawnRequested) { SendLootReqErrorPacket(client, 0); return; } - if(IsPlayerCorpse() && dbid == 0) { + if(IsPlayerCorpse() && mDBID == 0) { // SendLootReqErrorPacket(client, 0); client->Message(13, "Warning: Corpse's dbid = 0! Corpse will not survive zone shutdown!"); std::cout << "Error: PlayerCorpse::MakeLootRequestPackets: dbid = 0!" << std::endl; // return; } - if(pLocked && client->Admin() < 100) { + if(mLocked && client->Admin() < 100) { SendLootReqErrorPacket(client, 0); client->Message(13, "Error: Corpse locked by GM."); return; } - if(BeingLootedBy == 0) { BeingLootedBy = 0xFFFFFFFF; } + if(mBeingLootedBy == 0) { mBeingLootedBy = 0xFFFFFFFF; } - if(this->BeingLootedBy != 0xFFFFFFFF) { + if(this->mBeingLootedBy != 0xFFFFFFFF) { // lets double check.... - Entity* looter = entity_list.GetID(this->BeingLootedBy); - if(looter == 0) { this->BeingLootedBy = 0xFFFFFFFF; } + Entity* looter = entity_list.GetID(this->mBeingLootedBy); + if(looter == 0) { this->mBeingLootedBy = 0xFFFFFFFF; } } uint8 tCanLoot = 1; bool lootcoin = false; if(database.GetVariable("LootCoin", tmp, 9)) { lootcoin = (atoi(tmp) == 1); } - if(this->BeingLootedBy != 0xFFFFFFFF && this->BeingLootedBy != client->GetID()) { + if(this->mBeingLootedBy != 0xFFFFFFFF && this->mBeingLootedBy != client->GetID()) { SendLootReqErrorPacket(client, 0); tCanLoot = 0; } - else if(IsPlayerCorpse() && charid == client->CharacterID()) { tCanLoot = 2; } - else if((IsNPCCorpse() || become_npc) && CanMobLoot(client->CharacterID())) { tCanLoot = 2; } - else if(GetPKItem() == -1 && CanMobLoot(client->CharacterID())) { tCanLoot = 3; } //pvp loot all items, variable cash - else if(GetPKItem() == 1 && CanMobLoot(client->CharacterID())) { tCanLoot = 4; } //pvp loot 1 item, variable cash - else if(GetPKItem() > 1 && CanMobLoot(client->CharacterID())) { tCanLoot = 5; } //pvp loot 1 set item, variable cash + else if(IsPlayerCorpse() && mCharacterID == client->CharacterID()) { tCanLoot = 2; } + else if(IsNPCCorpse() && canMobLoot(client->CharacterID())) { tCanLoot = 2; } + else if(getPKItem() == -1 && canMobLoot(client->CharacterID())) { tCanLoot = 3; } //pvp loot all items, variable cash + else if(getPKItem() == 1 && canMobLoot(client->CharacterID())) { tCanLoot = 4; } //pvp loot 1 item, variable cash + else if(getPKItem() > 1 && canMobLoot(client->CharacterID())) { tCanLoot = 5; } //pvp loot 1 set item, variable cash if(tCanLoot == 1) { if(client->Admin() < 100 || !client->GetGM()) { SendLootReqErrorPacket(client, 2); } } if(tCanLoot >= 2 || (tCanLoot == 1 && client->Admin() >= 100 && client->GetGM())) { - this->BeingLootedBy = client->GetID(); + this->mBeingLootedBy = client->GetID(); EQApplicationPacket* outapp = new EQApplicationPacket(OP_MoneyOnCorpse, sizeof(moneyOnCorpseStruct)); moneyOnCorpseStruct* d = (moneyOnCorpseStruct*) outapp->pBuffer; @@ -960,17 +951,17 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a d->gold = 0; d->platinum = 0; Group *cgroup = client->GetGroup(); - cgroup->SplitMoney(GetCopper(), GetSilver(), GetGold(), GetPlatinum(), client); + cgroup->SplitMoney(getCopper(), getSilver(), getGold(), getPlatinum(), client); } else { - d->copper = this->GetCopper(); - d->silver = this->GetSilver(); - d->gold = this->GetGold(); - d->platinum = this->GetPlatinum(); - client->AddMoneyToPP(GetCopper(), GetSilver(), GetGold(), GetPlatinum(), false); + d->copper = this->getCopper(); + d->silver = this->getSilver(); + d->gold = this->getGold(); + d->platinum = this->getPlatinum(); + client->AddMoneyToPP(getCopper(), getSilver(), getGold(), getPlatinum(), false); } - RemoveCash(); + removeCash(); Save(); client->Save(); } @@ -979,14 +970,14 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a client->QueuePacket(outapp); safe_delete(outapp); if(tCanLoot == 5) { - int pkitem = GetPKItem(); + int pkitem = getPKItem(); const Item_Struct* item = database.GetItem(pkitem); ItemInst* inst = database.CreateItem(item, item->MaxCharges); if(inst) { client->SendItemPacket(22, inst, ItemPacketLoot); safe_delete(inst); } - else { client->Message(13, "Could not find item number %i to send!!", GetPKItem()); } + else { client->Message(13, "Could not find item number %i to send!!", getPKItem()); } client->QueuePacket(app); return; @@ -995,8 +986,8 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a int i = 0; const Item_Struct* item = 0; ItemList::iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); uint8 containercount = 0; int corpselootlimit; @@ -1032,20 +1023,20 @@ void Corpse::MakeLootRequestPackets(Client* client, const EQApplicationPacket* a } } - if(IsPlayerCorpse() && (charid == client->CharacterID() || client->GetGM())) { + if(IsPlayerCorpse() && (mCharacterID == client->CharacterID() || client->GetGM())) { if(i > corpselootlimit) { client->Message(15, "*** This corpse contains more items than can be displayed! ***"); client->Message(0, "Remove items and re-loot corpse to access remaining inventory."); client->Message(0, "(%s contains %i additional %s.)", GetName(), (i - corpselootlimit), (i - corpselootlimit) == 1 ? "item" : "items"); } - if(IsPlayerCorpse() && i == 0 && itemlist.size() > 0) { // somehow, player corpse contains items, but client doesn't see them... + if(IsPlayerCorpse() && i == 0 && mItems.size() > 0) { // somehow, player corpse contains items, but client doesn't see them... client->Message(13, "This corpse contains items that are inaccessable!"); client->Message(15, "Contact a GM for item replacement, if necessary."); - client->Message(15, "BUGGED CORPSE [DBID: %i, Name: %s, Item Count: %i]", GetDBID(), GetName(), itemlist.size()); + client->Message(15, "BUGGED CORPSE [DBID: %i, Name: %s, Item Count: %i]", GetDBID(), GetName(), mItems.size()); - cur = itemlist.begin(); - end = itemlist.end(); + cur = mItems.begin(); + end = mItems.end(); for(; cur != end; ++cur) { ServerLootItem_Struct* item_data = *cur; item = database.GetItem(item_data->item_id); @@ -1069,7 +1060,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) //this gets sent out no matter what as a sort of 'ack', so send it here. client->QueuePacket(app); - if(!loot_cooldown_timer.Check()) + if(!mCoolDownTimer.Check()) { SendEndLootErrorPacket(client); return; @@ -1085,25 +1076,25 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) LootingItem_Struct* lootitem = (LootingItem_Struct*)app->pBuffer; - if (this->BeingLootedBy != client->GetID()) { + if (this->mBeingLootedBy != client->GetID()) { client->Message(13, "Error: Corpse::LootItem: BeingLootedBy != client"); SendEndLootErrorPacket(client); return; } - if (IsPlayerCorpse() && !CanMobLoot(client->CharacterID()) && !become_npc && (charid != client->CharacterID() && client->Admin() < 150)) { + if (IsPlayerCorpse() && !canMobLoot(client->CharacterID()) && (mCharacterID != client->CharacterID() && client->Admin() < 150)) { client->Message(13, "Error: This is a player corpse and you dont own it."); SendEndLootErrorPacket(client); return; } - if (pLocked && client->Admin() < 100) { + if (mLocked && client->Admin() < 100) { SendLootReqErrorPacket(client, 0); client->Message(13, "Error: Corpse locked by GM."); return; } - if(IsPlayerCorpse() && (charid != client->CharacterID()) && CanMobLoot(client->CharacterID()) && GetPKItem()==0){ + if(IsPlayerCorpse() && (mCharacterID != client->CharacterID()) && canMobLoot(client->CharacterID()) && getPKItem()==0){ client->Message(13, "Error: You cannot loot any more items from this corpse."); SendEndLootErrorPacket(client); - BeingLootedBy = 0xFFFFFFFF; + mBeingLootedBy = 0xFFFFFFFF; return; } const Item_Struct* item = 0; @@ -1111,14 +1102,14 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) ServerLootItem_Struct* item_data = nullptr, *bag_item_data[10]; memset(bag_item_data, 0, sizeof(bag_item_data)); - if(GetPKItem()>1) - item = database.GetItem(GetPKItem()); - else if(GetPKItem()==-1 || GetPKItem()==1) + if(getPKItem()>1) + item = database.GetItem(getPKItem()); + else if(getPKItem()==-1 || getPKItem()==1) item_data = GetItem(lootitem->slot_id - 22); //dont allow them to loot entire bags of items as pvp reward else item_data = GetItem(lootitem->slot_id - 22, bag_item_data); - if (GetPKItem()<=1 && item_data != 0) + if (getPKItem()<=1 && item_data != 0) { item = database.GetItem(item_data->item_id); } @@ -1138,7 +1129,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { client->Message_StringID(0,LOOT_LORE_ERROR); SendEndLootErrorPacket(client); - BeingLootedBy = 0; + mBeingLootedBy = 0; delete inst; return; } @@ -1154,7 +1145,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) { client->Message_StringID(0,LOOT_LORE_ERROR); SendEndLootErrorPacket(client); - BeingLootedBy = 0; + mBeingLootedBy = 0; delete inst; return; } @@ -1240,7 +1231,7 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) if(item_data) RemoveItem(item_data->lootslot); // remove bag contents too - if (item->ItemClass == ItemClassContainer && (GetPKItem()!=-1 || GetPKItem()!=1)) + if (item->ItemClass == ItemClassContainer && (getPKItem()!=-1 || getPKItem()!=1)) { for (int i=0; i < 10; i++) { @@ -1251,8 +1242,8 @@ void Corpse::LootItem(Client* client, const EQApplicationPacket* app) } } - if(GetPKItem()!=-1) - SetPKItem(0); + if(getPKItem()!=-1) + setPKItem(0); //now send messages to all interested parties @@ -1303,7 +1294,7 @@ void Corpse::EndLoot(Client* client, const EQApplicationPacket* app) { safe_delete(outapp); //client->Save(); //inventory operations auto-commit - this->BeingLootedBy = 0xFFFFFFFF; + this->mBeingLootedBy = 0xFFFFFFFF; if (this->IsEmpty()) Delete(); else @@ -1322,24 +1313,21 @@ void Corpse::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho) ns->spawn.NPC = 2; } -void Corpse::QueryLoot(Client* to) { +void Corpse::queryLoot(Client* pClient) { int x = 0, y = 0; // x = visible items, y = total items - to->Message(0, "Coin: %ip, %ig, %is, %ic", platinum, gold, silver, copper); - - ItemList::iterator cur,end; - cur = itemlist.begin(); - end = itemlist.end(); + pClient->Message(0, "Coin: %ip, %ig, %is, %ic", mPlatinum, mGold, mSilver, mCopper); int corpselootlimit; - if (to->GetClientVersion() >= EQClientSoF) { corpselootlimit = 32; } - else if (to->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; } + if (pClient->GetClientVersion() >= EQClientSoF) { corpselootlimit = 32; } + else if (pClient->GetClientVersion() == EQClientTitanium) { corpselootlimit = 31; } else { corpselootlimit = 30; } - for(; cur != end; ++cur) { - ServerLootItem_Struct* sitem = *cur; + for (auto i = mItems.begin(); i != mItems.end(); i++) { + ServerLootItem_Struct* sitem = *i; + // Inspecting a player corpse. if (IsPlayerCorpse()) { if (sitem->equipSlot >= 251 && sitem->equipSlot <= 340) sitem->lootslot = 0xFFFF; @@ -1349,33 +1337,34 @@ void Corpse::QueryLoot(Client* to) { const Item_Struct* item = database.GetItem(sitem->item_id); if (item) - to->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast(sitem->lootslot), sitem->equipSlot, item->Name, item->ID, sitem->charges); + pClient->Message((sitem->lootslot == 0xFFFF), "LootSlot: %i (EquipSlot: %i) Item: %s (%d), Count: %i", static_cast(sitem->lootslot), sitem->equipSlot, item->Name, item->ID, sitem->charges); else - to->Message((sitem->lootslot == 0xFFFF), "Error: 0x%04x", sitem->item_id); + pClient->Message((sitem->lootslot == 0xFFFF), "Error: 0x%04x", sitem->item_id); if (sitem->lootslot != 0xFFFF) x++; y++; } + // Inspecting a non-player corpse. else { sitem->lootslot=y; const Item_Struct* item = database.GetItem(sitem->item_id); if (item) - to->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges); + pClient->Message(0, "LootSlot: %i Item: %s (%d), Count: %i", sitem->lootslot, item->Name, item->ID, sitem->charges); else - to->Message(0, "Error: 0x%04x", sitem->item_id); + pClient->Message(0, "Error: 0x%04x", sitem->item_id); y++; } } if (IsPlayerCorpse()) { - to->Message(0, "%i visible %s (%i total) on %s (DBID: %i).", x, x==1?"item":"items", y, this->GetName(), this->GetDBID()); + pClient->Message(0, "%i visible %s (%i total) on %s (DBID: %i).", x, x==1?"item":"items", y, this->GetName(), this->GetDBID()); } else { - to->Message(0, "%i %s on %s.", y, y==1?"item":"items", this->GetName()); + pClient->Message(0, "%i %s on %s.", y, y==1?"item":"items", this->GetName()); } } @@ -1383,15 +1372,15 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) { uint32 dist2 = 10000; // pow(100, 2); if (!spell) { - if (this->GetCharID() == client->CharacterID()) { - if (IsLocked() && client->Admin() < 100) { + if (this->getCharacterID() == client->CharacterID()) { + if (isLocked() && client->Admin() < 100) { client->Message(13, "That corpse is locked by a GM."); return false; } if (!CheckDistance || (DistNoRootNoZ(*client) <= dist2)) { GMMove(client->GetX(), client->GetY(), client->GetZ()); - pIsChanged = true; + mChanged = true; } else { @@ -1410,7 +1399,7 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) if (!CheckDistance || (DistNoRootNoZ(*client) <= dist2)) { GMMove(client->GetX(), client->GetY(), client->GetZ()); - pIsChanged = true; + mChanged = true; } else { @@ -1429,15 +1418,15 @@ bool Corpse::Summon(Client* client, bool spell, bool CheckDistance) } else { GMMove(client->GetX(), client->GetY(), client->GetZ()); - pIsChanged = true; + mChanged = true; } Save(); return true; } -void Corpse::CompleteRezz(){ - rezzexp = 0; - pIsChanged = true; +void Corpse::CompleteResurrection(){ + mResurrectionExp = 0; + mChanged = true; this->Save(); } @@ -1555,7 +1544,7 @@ uint32 ZoneDatabase::GraveyardPlayerCorpse(uint32 dbid, uint32 zoneid, uint16 in } return dbid; } -uint32 ZoneDatabase::UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading, bool rezzed) { +uint32 ZoneDatabase::UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading, bool isResurrected) { char errbuf[MYSQL_ERRMSG_SIZE]; char* query = new char[256+(datasize*2)]; char* end = query; @@ -1578,23 +1567,23 @@ uint32 ZoneDatabase::UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char* std::cerr << "Error2 in UpdatePlayerCorpse query: affected_rows = 0" << std::endl; return 0; } - if(rezzed){ - if (!RunQuery(query, MakeAnyLenString(&query, "update player_corpses set rezzed = 1 WHERE id=%d",dbid), errbuf)) { - std::cerr << "Error in UpdatePlayerCorpse/Rezzed query: " << errbuf << std::endl; + if(isResurrected){ + if (!RunQuery(query, MakeAnyLenString(&query, "update player_corpses set isResurrected = 1 WHERE id=%d",dbid), errbuf)) { + std::cerr << "Error in UpdatePlayerCorpse/isResurrected query: " << errbuf << std::endl; } safe_delete_array(query); } return dbid; } -void ZoneDatabase::MarkCorpseAsRezzed(uint32 dbid) +void ZoneDatabase::MarkCorpseAsResurrected(uint32 dbid) { char errbuf[MYSQL_ERRMSG_SIZE]; char* query = 0; - if(!database.RunQuery(query,MakeAnyLenString(&query, "UPDATE player_corpses SET rezzed = 1 WHERE id = %i", dbid), errbuf)) + if(!database.RunQuery(query,MakeAnyLenString(&query, "UPDATE player_corpses SET isResurrected = 1 WHERE id = %i", dbid), errbuf)) { - LogFile->write(EQEMuLog::Error, "MarkCorpseAsRezzed failed: %s, %s", query, errbuf); + LogFile->write(EQEMuLog::Error, "MarkCorpseAsResurrected failed: %s, %s", query, errbuf); } safe_delete_array(query); } @@ -1612,7 +1601,7 @@ uint32 ZoneDatabase::CreatePlayerCorpse(uint32 charid, const char* charname, uin *end++ = '\''; end += DoEscapeString(end, (char*)data, datasize); *end++ = '\''; - end += sprintf(end,", charname='%s', zoneid=%u, instanceid=%u, charid=%d, x=%1.1f, y=%1.1f, z=%1.1f, heading=%1.1f, timeofdeath=Now(), IsBurried=0", charname, zoneid, instanceid, charid, x, y, z, heading); + end += sprintf(end,", charname='%s', zoneid=%u, instanceid=%u, charid=%d, x=%1.1f, y=%1.1f, z=%1.1f, heading=%1.1f, timeofdeath=Now(), isBuried=0", charname, zoneid, instanceid, charid, x, y, z, heading); if (!RunQuery(query, (uint32) (end - query), errbuf, 0, &affected_rows, &last_insert_id)) { safe_delete_array(query); @@ -1649,7 +1638,7 @@ bool ZoneDatabase::CreatePlayerCorpseBackup(uint32 dbid, uint32 charid, const ch *end++ = '\''; end += DoEscapeString(end, (char*)data, datasize); *end++ = '\''; - end += sprintf(end,", charname='%s', zoneid=%u, instanceid=%u, charid=%d, x=%1.1f, y=%1.1f, z=%1.1f, heading=%1.1f, timeofdeath=Now(), IsBurried=0, id=%u", charname, zoneid, instanceid, charid, x, y, z, heading, dbid); + end += sprintf(end,", charname='%s', zoneid=%u, instanceid=%u, charid=%d, x=%1.1f, y=%1.1f, z=%1.1f, heading=%1.1f, timeofdeath=Now(), isBuried=0, id=%u", charname, zoneid, instanceid, charid, x, y, z, heading, dbid); if (RunQuery(query, (uint32) (end - query), errbuf, 0, &affected_rows)) { if (affected_rows == 1) @@ -1668,20 +1657,20 @@ bool ZoneDatabase::CreatePlayerCorpseBackup(uint32 dbid, uint32 charid, const ch return result; } -uint32 ZoneDatabase::GetPlayerBurriedCorpseCount(uint32 char_id) { +uint32 ZoneDatabase::GetPlayerBuriedCorpseCount(uint32 char_id) { char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; MYSQL_RES *result; MYSQL_ROW row; uint32 CorpseCount = 0; - if (RunQuery(query, MakeAnyLenString(&query, "select count(*) from player_corpses where charid = '%u' and IsBurried = 1", char_id), errbuf, &result)) { + if (RunQuery(query, MakeAnyLenString(&query, "select count(*) from player_corpses where charid = '%u' and isBuried = 1", char_id), errbuf, &result)) { row = mysql_fetch_row(result); CorpseCount = atoi(row[0]); mysql_free_result(result); } else { - std::cerr << "Error in GetPlayerBurriedCorpseCount query '" << query << "' " << errbuf << std::endl; + std::cerr << "Error in GetPlayerBuriedCorpseCount query '" << query << "' " << errbuf << std::endl; } safe_delete_array(query); @@ -1744,7 +1733,7 @@ uint32 ZoneDatabase::GetPlayerCorpseItemAt(uint32 corpse_id, uint16 slotid) { return itemid; } -Corpse* ZoneDatabase::SummonBurriedPlayerCorpse(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading) { +Corpse* ZoneDatabase::SummonBuriedPlayerCorpse(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading) { char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; MYSQL_RES *result; @@ -1752,7 +1741,7 @@ Corpse* ZoneDatabase::SummonBurriedPlayerCorpse(uint32 char_id, uint32 dest_zone Corpse* NewCorpse = 0; unsigned long* lengths; - if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charname, data, timeofdeath, rezzed FROM player_corpses WHERE charid='%u' AND IsBurried=1 ORDER BY timeofdeath LIMIT 1", char_id), errbuf, &result)) { + if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charname, data, timeofdeath, isResurrected FROM player_corpses WHERE charid='%u' AND isBuried=1 ORDER BY timeofdeath LIMIT 1", char_id), errbuf, &result)) { row = mysql_fetch_row(result); lengths = mysql_fetch_lengths(result); if(row) { @@ -1765,13 +1754,13 @@ Corpse* ZoneDatabase::SummonBurriedPlayerCorpse(uint32 char_id, uint32 dest_zone LogFile->write(EQEMuLog::Error, "Unable to unbury a summoned player corpse for character id %u.", char_id); } else - LogFile->write(EQEMuLog::Error, "Unable to construct a player corpse from a burried player corpse for character id %u.", char_id); + LogFile->write(EQEMuLog::Error, "Unable to construct a player corpse from a buried player corpse for character id %u.", char_id); } mysql_free_result(result); } else { - std::cerr << "Error in SummonBurriedPlayerCorpse query '" << query << "' " << errbuf << std::endl; + std::cerr << "Error in SummonBuriedPlayerCorpse query '" << query << "' " << errbuf << std::endl; } safe_delete_array(query); @@ -1791,13 +1780,13 @@ bool ZoneDatabase::SummonAllPlayerCorpses(uint32 char_id, uint32 dest_zoneid, ui unsigned long* lengths; if(!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET zoneid = %i, instanceid = %i, x = %f, y = %f, z = %f, " - "heading = %f, IsBurried = 0, WasAtGraveyard = 0 WHERE charid = %i", + "heading = %f, isBuried = 0, WasAtGraveyard = 0 WHERE charid = %i", dest_zoneid, dest_instanceid, dest_x, dest_y, dest_z, dest_heading, char_id), errbuf)) LogFile->write(EQEMuLog::Error, "Error moving corpses, Query = %s, Error = %s\n", query, errbuf); safe_delete_array(query); - if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charname, data, timeofdeath, rezzed FROM player_corpses WHERE charid='%u'" + if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charname, data, timeofdeath, isResurrected FROM player_corpses WHERE charid='%u'" "ORDER BY timeofdeath", char_id), errbuf, &result)) { while((row = mysql_fetch_row(result))) @@ -1832,7 +1821,7 @@ bool ZoneDatabase::UnburyPlayerCorpse(uint32 dbid, uint32 new_zoneid, uint16 new uint32 affected_rows = 0; bool Result = false; - end += sprintf(end, "UPDATE player_corpses SET IsBurried=0, zoneid=%u, instanceid=%u, x=%f, y=%f, z=%f, heading=%f, timeofdeath=Now(), WasAtGraveyard=0 WHERE id=%u", new_zoneid, new_instanceid, new_x, new_y, new_z, new_heading, dbid); + end += sprintf(end, "UPDATE player_corpses SET isBuried=0, zoneid=%u, instanceid=%u, x=%f, y=%f, z=%f, heading=%f, timeofdeath=Now(), WasAtGraveyard=0 WHERE id=%u", new_zoneid, new_instanceid, new_x, new_y, new_z, new_heading, dbid); if (RunQuery(query, (uint32) (end - query), errbuf, 0, &affected_rows)) { if (affected_rows == 1) @@ -1856,7 +1845,7 @@ Corpse* ZoneDatabase::LoadPlayerCorpse(uint32 player_corpse_id) { Corpse* NewCorpse = 0; unsigned long* lengths; - if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charid, charname, x, y, z, heading, data, timeofdeath, rezzed, WasAtGraveyard FROM player_corpses WHERE id='%u'", player_corpse_id), errbuf, &result)) { + if (RunQuery(query, MakeAnyLenString(&query, "SELECT id, charid, charname, x, y, z, heading, data, timeofdeath, isResurrected, WasAtGraveyard FROM player_corpses WHERE id='%u'", player_corpse_id), errbuf, &result)) { row = mysql_fetch_row(result); lengths = mysql_fetch_lengths(result); if(row && lengths) @@ -1868,7 +1857,7 @@ Corpse* ZoneDatabase::LoadPlayerCorpse(uint32 player_corpse_id) { } else { std::cerr << "Error in LoadPlayerCorpse query '" << query << "' " << errbuf << std::endl; - std::cerr << "Note that if your missing the 'rezzed' field you can add it with:\nALTER TABLE `player_corpses` ADD `rezzed` TINYINT UNSIGNED DEFAULT \"0\";\n"; + std::cerr << "Note that if your missing the 'isResurrected' field you can add it with:\nALTER TABLE `player_corpses` ADD `isResurrected` TINYINT UNSIGNED DEFAULT \"0\";\n"; } safe_delete_array(query); @@ -1886,9 +1875,9 @@ bool ZoneDatabase::LoadPlayerCorpses(uint32 iZoneID, uint16 iInstanceID) { unsigned long* lengths; if(!RuleB(Zone, EnableShadowrest)) - query_length = MakeAnyLenString(&query, "SELECT id, charid, charname, x, y, z, heading, data, timeofdeath, rezzed, WasAtGraveyard FROM player_corpses WHERE zoneid='%u' AND instanceid='%u'", iZoneID, iInstanceID); + query_length = MakeAnyLenString(&query, "SELECT id, charid, charname, x, y, z, heading, data, timeofdeath, isResurrected, WasAtGraveyard FROM player_corpses WHERE zoneid='%u' AND instanceid='%u'", iZoneID, iInstanceID); else - query_length = MakeAnyLenString(&query, "SELECT id, charid, charname, x, y, z, heading, data, timeofdeath, rezzed, 0 FROM player_corpses WHERE zoneid='%u' AND instanceid='%u' AND IsBurried=0", iZoneID, iInstanceID); + query_length = MakeAnyLenString(&query, "SELECT id, charid, charname, x, y, z, heading, data, timeofdeath, isResurrected, 0 FROM player_corpses WHERE zoneid='%u' AND instanceid='%u' AND isBuried=0", iZoneID, iInstanceID); if (RunQuery(query, query_length, errbuf, &result)) { safe_delete_array(query); @@ -1900,7 +1889,7 @@ bool ZoneDatabase::LoadPlayerCorpses(uint32 iZoneID, uint16 iInstanceID) { } else { std::cerr << "Error in LoadPlayerCorpses query '" << query << "' " << errbuf << std::endl; - std::cerr << "Note that if your missing the 'rezzed' field you can add it with:\nALTER TABLE `player_corpses` ADD `rezzed` TINYINT UNSIGNED DEFAULT \"0\";\n"; + std::cerr << "Note that if your missing the 'isResurrected' field you can add it with:\nALTER TABLE `player_corpses` ADD `isResurrected` TINYINT UNSIGNED DEFAULT \"0\";\n"; safe_delete_array(query); return false; } @@ -1915,7 +1904,7 @@ uint32 ZoneDatabase::GetFirstCorpseID(uint32 char_id) { MYSQL_ROW row; uint32 CorpseID = 0; - MakeAnyLenString(&query, "SELECT id FROM player_corpses WHERE charid='%u' AND IsBurried=0 ORDER BY timeofdeath LIMIT 1", char_id); + MakeAnyLenString(&query, "SELECT id FROM player_corpses WHERE charid='%u' AND isBuried=0 ORDER BY timeofdeath LIMIT 1", char_id); if (RunQuery(query, strlen(query), errbuf, &result)) { if (mysql_num_rows(result)!= 0){ row = mysql_fetch_row(result); @@ -1937,7 +1926,7 @@ bool ZoneDatabase::BuryPlayerCorpse(uint32 dbid) { char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; - if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET IsBurried = 1 WHERE id=%d", dbid), errbuf)) { + if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET isBuried = 1 WHERE id=%d", dbid), errbuf)) { std::cerr << "Error in BuryPlayerCorpse query '" << query << "' " << errbuf << std::endl; safe_delete_array(query); return false; @@ -1951,7 +1940,7 @@ bool ZoneDatabase::BuryAllPlayerCorpses(uint32 charid) { char errbuf[MYSQL_ERRMSG_SIZE]; char *query = 0; - if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET IsBurried = 1 WHERE charid=%d", charid), errbuf)) { + if (!RunQuery(query, MakeAnyLenString(&query, "UPDATE player_corpses SET isBuried = 1 WHERE charid=%d", charid), errbuf)) { std::cerr << "Error in BuryPlayerCorpse query '" << query << "' " << errbuf << std::endl; safe_delete_array(query); return false; @@ -2002,22 +1991,22 @@ uint32 Corpse::GetEquipmentColor(uint8 material_slot) const { item = database.GetItem(GetEquipment(material_slot)); if(item != 0) { - return item_tint[material_slot].rgb.use_tint ? - item_tint[material_slot].color : + return mItemTints[material_slot].rgb.use_tint ? + mItemTints[material_slot].color : item->Color; } return 0; } -void Corpse::AddLooter(Mob* who) +void Corpse::addLooter(Mob* pCharacter) { - for (int i=0; iCastToClient()->CharacterID(); - break; + mLooters[i] = pCharacter->CastToClient()->CharacterID(); + return; } } } @@ -2033,26 +2022,26 @@ void Corpse::LoadPlayerCorpseDecayTime(uint32 dbid){ safe_delete_array(query); while ((row = mysql_fetch_row(result))) { if(atoi(row[0]) > 0 && RuleI(Character, CorpseDecayTimeMS) > (atoi(row[0]) * 1000)) { - corpse_decay_timer.SetTimer(RuleI(Character, CorpseDecayTimeMS) - (atoi(row[0]) * 1000)); + mDecayTimer.SetTimer(RuleI(Character, CorpseDecayTimeMS) - (atoi(row[0]) * 1000)); /* if(RuleI(Character, CorpseResTimeMS) > (atoi(row[0]) * 1000)) { - corpse_res_timer.SetTimer(RuleI(Character, CorpseResTimeMS) - (atoi(row[0]) * 1000)); + corpse_resurrect_timer.SetTimer(RuleI(Character, CorpseResTimeMS) - (atoi(row[0]) * 1000)); } else { - corpse_res_timer.Disable(); - can_rez = false; + corpse_resurrect_timer.Disable(); + can_resurrect = false; } */ } else { - corpse_decay_timer.SetTimer(2000); + mDecayTimer.SetTimer(2000); //corpse_res_timer.SetTimer(300000); } if(atoi(row[0]) > 0 && RuleI(Zone, GraveyardTimeMS) > (atoi(row[0]) * 1000)) { - corpse_graveyard_timer.SetTimer(RuleI(Zone, GraveyardTimeMS) - (atoi(row[0]) * 1000)); + mGraveyardTimer.SetTimer(RuleI(Zone, GraveyardTimeMS) - (atoi(row[0]) * 1000)); } else { - corpse_graveyard_timer.SetTimer(3000); + mGraveyardTimer.SetTimer(3000); } } @@ -2063,25 +2052,25 @@ void Corpse::LoadPlayerCorpseDecayTime(uint32 dbid){ } /* -void Corpse::CastRezz(uint16 spellid, Mob* Caster){ - if(Rezzed()){ +void Corpse::CastResurrection(uint16 spellid, Mob* Caster){ + if(isResurrected()){ if(Caster && Caster->IsClient()) Caster->Message(13,"This character has already been resurrected."); return; } - APPLAYER* outapp = new APPLAYER(OP_RezzRequest, sizeof(Resurrect_Struct)); - Resurrect_Struct* rezz = (Resurrect_Struct*) outapp->pBuffer; - memcpy(rezz->your_name,this->orgname,30); - memcpy(rezz->corpse_name,this->name,30); - memcpy(rezz->rezzer_name,Caster->GetName(),30); - memcpy(rezz->zone,zone->GetShortName(),15); - rezz->spellid = spellid; - rezz->x = this->x_pos; - rezz->y = this->y_pos; - rezz->z = (float)this->z_pos; - worldserver.RezzPlayer(outapp, rezzexp, OP_RezzRequest); + APPLAYER* outapp = new APPLAYER(OP_ResurrectionRequest, sizeof(Resurrect_Struct)); + Resurrect_Struct* resurrect = (Resurrect_Struct*) outapp->pBuffer; + memcpy(resurrect->your_name,this->orgname,30); + memcpy(resurrect->corpse_name,this->name,30); + memcpy(resurrect->resurrecter_name,Caster->GetName(),30); + memcpy(resurrect->zone,zone->GetShortName(),15); + resurrect->spellid = spellid; + resurrect->x = this->x_pos; + resurrect->y = this->y_pos; + resurrect->z = (float)this->z_pos; + worldserver.ResurrectPlayer(outapp, mRessurectionExp, OP_ResurrectionRequest); //DumpPacket(outapp); safe_delete(outapp); } -*/ +*/ \ No newline at end of file diff --git a/zone/corpse.h b/zone/corpse.h index b9999e79b..6496a9110 100644 --- a/zone/corpse.h +++ b/zone/corpse.h @@ -51,22 +51,18 @@ public: void LoadPlayerCorpseDecayTime(uint32 dbid); bool IsCorpse() const { return true; } - bool IsPlayerCorpse() const { return p_PlayerCorpse; } - bool IsNPCCorpse() const { return !p_PlayerCorpse; } - bool IsBecomeNPCCorpse() const { return become_npc; } + bool IsPlayerCorpse() const { return mPlayerCorpse; } + bool IsNPCCorpse() const { return !mPlayerCorpse; } bool Process(); bool Save(); - uint32 GetCharID() { return charid; } - uint32 SetCharID(uint32 iCharID) { if (IsPlayerCorpse()) { return (charid=iCharID); } return 0xFFFFFFFF; }; - uint32 GetDecayTime() { if (!corpse_decay_timer.Enabled()) return 0xFFFFFFFF; else return corpse_decay_timer.GetRemainingTime(); } - uint32 GetResTime() { if (!corpse_res_timer.Enabled()) return 0; else return corpse_res_timer.GetRemainingTime(); } + + uint32 GetDecayTime() { if (!mDecayTimer.Enabled()) return 0xFFFFFFFF; else return mDecayTimer.GetRemainingTime(); } + uint32 GetResTime() { if (!mResurrectionTimer.Enabled()) return 0; else return mResurrectionTimer.GetRemainingTime(); } void CalcCorpseName(); - inline void Lock() { pLocked = true; } - inline void UnLock() { pLocked = false; } - inline bool IsLocked() { return pLocked; } - inline void ResetLooter() { BeingLootedBy = 0xFFFFFFFF; } - inline bool IsBeingLooted() { return (BeingLootedBy != 0xFFFFFFFF); } - inline uint32 GetDBID() { return dbid; } + + inline void ResetLooter() { mBeingLootedBy = 0xFFFFFFFF; } + inline bool IsBeingLooted() { return (mBeingLootedBy != 0xFFFFFFFF); } + inline uint32 GetDBID() { return mDBID; } inline char* GetOwnerName() { return orgname;} void SetDecayTimer(uint32 decaytime); @@ -76,68 +72,118 @@ public: ServerLootItem_Struct* GetItem(uint16 lootslot, ServerLootItem_Struct** bag_item_data = 0); void RemoveItem(uint16 lootslot); void RemoveItem(ServerLootItem_Struct* item_data); - void SetCash(uint32 in_copper, uint32 in_silver, uint32 in_gold, uint32 in_platinum); - void RemoveCash(); - void QueryLoot(Client* to); - uint32 CountItems(); + + + + void Delete(); void Bury(); virtual void Depop(); virtual void DepopCorpse(); - uint32 GetCopper() { return copper; } - uint32 GetSilver() { return silver; } - uint32 GetGold() { return gold; } - uint32 GetPlatinum() { return platinum; } - void FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho); void MakeLootRequestPackets(Client* client, const EQApplicationPacket* app); void LootItem(Client* client, const EQApplicationPacket* app); void EndLoot(Client* client, const EQApplicationPacket* app); bool Summon(Client* client, bool spell, bool CheckDistance); - void CastRezz(uint16 spellid, Mob* Caster); - void CompleteRezz(); - void SetPKItem(int32 id) { pkitem = id; } - int32 GetPKItem() { return pkitem; } - bool CanMobLoot(int charid); - void AllowMobLoot(Mob *them, uint8 slot); - void AddLooter(Mob *who); - bool Rezzed() { return rez; } - void Rezzed(bool in_rez) { rez = in_rez; } + + + bool canMobLoot(int charid); + + void AllowMobLoot(Mob* pCharacer, uint8 pSlot); + void addLooter(Mob* pCharacer); + void Spawn(); char orgname[64]; uint32 GetEquipment(uint8 material_slot) const; // returns item id uint32 GetEquipmentColor(uint8 material_slot) const; - inline int GetRezzExp() { return rezzexp; } + + // Sets the amount of coin on the corpse. + // (SCRIPTING) + void setCash(uint32 pCopper, uint32 pSilver, uint32 pGold, uint32 pPlatinum); + + // Removes all cash from the corpse. + void removeCash(); + + uint32 getCopper() { return mCopper; } + uint32 getSilver() { return mSilver; } + uint32 getGold() { return mGold; } + uint32 getPlatinum() { return mPlatinum; } + + // Returns the amount of EXP stored on this corpse. + inline int getResurrectionExp() { return mResurrectionExp; } + + void CastResurrection(uint16 spellid, Mob* Caster); + void CompleteResurrection(); + + // Returns whether this corpse has been resurrected. + bool isResurrected() { return mResurrected; } + + // Sets whether this corpse has been resurrected. + void setResurrected(bool pResurrected) { mResurrected = pResurrected; } + + void setPKItem(int32 id) { mPKItem = id; } + int32 getPKItem() { return mPKItem; } + + // Returns the Character ID this corpse belongs to. + uint32 getCharacterID() { return mCharacterID; } + // Sets the Character ID this corpse belongs to. + // (SCRIPTING) + uint32 setCharacterID(uint32 pCharacterID) { if (IsPlayerCorpse()) { return (mCharacterID = pCharacterID); } return 0xFFFFFFFF; }; + + // locks the corpse to prevent looting by non-GM characters. + // (SCRIPTING) + inline void lock() { mLocked = true; } + + // Unlocks the corpse to allow looting by non-GM characters. + // (SCRIPTING) + inline void unlock() { mLocked = false; } + + // Returns whether the corpse is locked. + // (SCRIPTING) + inline bool isLocked() { return mLocked; } + + // Returns the number of items on the corpse. + // (SCRIPTING) + uint32 getNumItems(); + + // Prints details of items/coin on corpse to client. + // (SCRIPTING) + void queryLoot(Client* pClient); protected: std::list MoveItemToCorpse(Client *client, ItemInst *item, int16 equipslot); private: - bool p_PlayerCorpse; bool pIsChanged; - bool pLocked; - int32 pkitem; - uint32 dbid; - uint32 charid; - ItemList itemlist; - uint32 copper; - uint32 silver; - uint32 gold; - uint32 platinum; - bool p_depop; - uint32 BeingLootedBy; - uint32 rezzexp; - bool rez; - bool can_rez; - bool become_npc; - int looters[MAX_LOOTERS]; // People allowed to loot the corpse, character id - Timer corpse_decay_timer; - Timer corpse_res_timer; - Timer corpse_delay_timer; - Timer corpse_graveyard_timer; - Timer loot_cooldown_timer; - Color_Struct item_tint[9]; + + bool mDespawnRequested; // Flag indicating that this corpse should despawn. + bool mChanged; // Flag indicating whether a player corpse has been changed since last save. + bool mResurrected; // Flag indicating whether the corpse has been resurrected. + bool mLocked; // Flag indicating whether the corpse has been locked. + bool mPlayerCorpse; // Flag indicating whether the corpse belongs to a player. + + // Coin + uint32 mCopper; + uint32 mSilver; + uint32 mGold; + uint32 mPlatinum; + + int32 mPKItem; // Not completely sure what this does yet. + uint32 mDBID; // ID field in 'player_corpses' table. + uint32 mCharacterID; // Character ID who owns this corpse + uint32 mBeingLootedBy; // Client ID of whoever is looting this corpse. + uint32 mResurrectionExp; // Amount of EXP the player lost creating this corpse. + + Timer mDecayTimer; // Timer controlling how long before this corpse decays. + Timer mResurrectionTimer; // Timer controlling how long this corpse can be resurrected. + Timer mCoolDownTimer; // Timer prevents anyone from looting a corpse within 10ms (No idea why). + Timer mGraveyardTimer; // Timer controlling when this corpse will be moved to the graveyard. + Timer mLockoutTimer; // Timer controlling how long before the corpse becomes open and allow anyone to loot. + + ItemList mItems; // List of items on the corpse. + int mLooters[MAX_LOOTERS]; // Character IDs of those allowed to loot this corpse. + Color_Struct mItemTints[9]; }; #endif diff --git a/zone/embparser_api.cpp b/zone/embparser_api.cpp index 6dec78d59..291227950 100644 --- a/zone/embparser_api.cpp +++ b/zone/embparser_api.cpp @@ -1738,12 +1738,12 @@ XS(XS__clear_zone_flag) XSRETURN_EMPTY; } -XS(XS__summonburriedplayercorpse); -XS(XS__summonburriedplayercorpse) +XS(XS__summonburiedplayercorpse); +XS(XS__summonburiedplayercorpse) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: summonburriedplayercorpse(char_id,dest_x,dest_y,dest_z,dest_heading)"); + Perl_croak(aTHX_ "Usage: summonburiedplayercorpse(char_id,dest_x,dest_y,dest_z,dest_heading)"); bool RETVAL; uint32 char_id = (int)SvIV(ST(0)); @@ -1752,7 +1752,7 @@ XS(XS__summonburriedplayercorpse) float dest_z = (float)SvIV(ST(3)); float dest_heading = (float)SvIV(ST(4)); - RETVAL = quest_manager.summonburriedplayercorpse(char_id, dest_x, dest_y, dest_z, dest_heading); + RETVAL = quest_manager.summonburiedplayercorpse(char_id, dest_x, dest_y, dest_z, dest_heading); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); @@ -1780,19 +1780,19 @@ XS(XS__summonallplayercorpses) XSRETURN(1); } -XS(XS__getplayerburriedcorpsecount); -XS(XS__getplayerburriedcorpsecount) +XS(XS__getplayerburiedcorpsecount); +XS(XS__getplayerburiedcorpsecount) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: getplayerburriedcorpsecount(char_id)"); + Perl_croak(aTHX_ "Usage: getplayerburiedcorpsecount(char_id)"); uint32 RETVAL; dXSTARG; uint32 char_id = (int)SvIV(ST(0)); - RETVAL = quest_manager.getplayerburriedcorpsecount(char_id); + RETVAL = quest_manager.getplayerburiedcorpsecount(char_id); XSprePUSH; PUSHu((IV)RETVAL); XSRETURN(1); @@ -3421,9 +3421,9 @@ EXTERN_C XS(boot_quest) newXS(strcpy(buf, "has_zone_flag"), XS__has_zone_flag, file); newXS(strcpy(buf, "set_zone_flag"), XS__set_zone_flag, file); newXS(strcpy(buf, "clear_zone_flag"), XS__clear_zone_flag, file); - newXS(strcpy(buf, "summonburriedplayercorpse"), XS__summonburriedplayercorpse, file); + newXS(strcpy(buf, "summonburiedplayercorpse"), XS__summonburiedplayercorpse, file); newXS(strcpy(buf, "summonallplayercorpses"), XS__summonallplayercorpses, file); - newXS(strcpy(buf, "getplayerburriedcorpsecount"), XS__getplayerburriedcorpsecount, file); + newXS(strcpy(buf, "getplayerburiedcorpsecount"), XS__getplayerburiedcorpsecount, file); newXS(strcpy(buf, "buryplayercorpse"), XS__buryplayercorpse, file); newXS(strcpy(buf, "forcedooropen"), XS__forcedooropen, file); newXS(strcpy(buf, "forcedoorclose"), XS__forcedoorclose, file); diff --git a/zone/entity.cpp b/zone/entity.cpp index 2b437718b..a9f3204a5 100644 --- a/zone/entity.cpp +++ b/zone/entity.cpp @@ -1599,7 +1599,7 @@ void EntityList::RemoveAllCorpsesByCharID(uint32 charid) { auto it = corpse_list.begin(); while (it != corpse_list.end()) { - if (it->second->GetCharID() == charid) { + if (it->second->getCharacterID() == charid) { safe_delete(it->second); free_ids.push(it->first); it = corpse_list.erase(it); @@ -1623,20 +1623,20 @@ void EntityList::RemoveCorpseByDBID(uint32 dbid) } } -int EntityList::RezzAllCorpsesByCharID(uint32 charid) +int EntityList::ResurrectAllCorpsesByCharID(uint32 charid) { - int RezzExp = 0; + int ResurrectionExp = 0; auto it = corpse_list.begin(); while (it != corpse_list.end()) { - if (it->second->GetCharID() == charid) { - RezzExp += it->second->GetRezzExp(); - it->second->Rezzed(true); - it->second->CompleteRezz(); + if (it->second->getCharacterID() == charid) { + ResurrectionExp += it->second->getResurrectionExp(); + it->second->setResurrected(true); + it->second->CompleteResurrection(); } ++it; } - return RezzExp; + return ResurrectionExp; } Group *EntityList::GetGroupByMob(Mob *mob) @@ -4353,7 +4353,7 @@ void EntityList::HideCorpses(Client *c, uint8 CurrentMode, uint8 NewMode) while (it != corpse_list.end()) { Corpse *b = it->second; - if (b && (b->GetCharID() != c->CharacterID())) { + if (b && (b->getCharacterID() != c->CharacterID())) { if ((NewMode == HideCorpseAll) || ((NewMode == HideCorpseNPC) && (b->IsNPCCorpse()))) { EQApplicationPacket outapp; b->CreateDespawnPacket(&outapp, false); diff --git a/zone/entity.h b/zone/entity.h index 11b9d8bb5..2155eafc8 100644 --- a/zone/entity.h +++ b/zone/entity.h @@ -169,7 +169,7 @@ public: Doors *GetDoorsByDBID(uint32 id); void RemoveAllCorpsesByCharID(uint32 charid); void RemoveCorpseByDBID(uint32 dbid); - int RezzAllCorpsesByCharID(uint32 charid); + int ResurrectAllCorpsesByCharID(uint32 charid); bool IsMobInZone(Mob *who); void ClearClientPetitionQueue(); bool CanAddHateForMob(Mob *p); diff --git a/zone/exp.cpp b/zone/exp.cpp index 3d7082b9f..0a5b35055 100644 --- a/zone/exp.cpp +++ b/zone/exp.cpp @@ -194,8 +194,8 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) { SetEXP(exp, aaexp, resexp); } -void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { - _log(CLIENT__EXP, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); +void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool ismRessurectionExp) { + _log(CLIENT__EXP, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Resurrect: %s)", this->GetCleanName(), set_exp, set_aaxp, ismRessurectionExp ? "true" : "false"); //max_AAXP = GetEXPForLevel(52) - GetEXPForLevel(51); //GetEXPForLevel() doesn't depend on class/race, just level, so it shouldn't change between Clients max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2() if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { @@ -205,8 +205,8 @@ void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { if ((set_exp + set_aaxp) > (m_pp.exp+m_pp.expAA)) { - if (isrezzexp) - this->Message_StringID(MT_Experience, REZ_REGAIN); + if (ismRessurectionExp) + this->Message_StringID(MT_Experience, RESURRECTION_REGAIN); else{ if(this->IsGrouped()) this->Message_StringID(MT_Experience, GAIN_GROUPXP); diff --git a/zone/lua_corpse.cpp b/zone/lua_corpse.cpp index 6498458ae..28fce9f21 100644 --- a/zone/lua_corpse.cpp +++ b/zone/lua_corpse.cpp @@ -9,7 +9,7 @@ uint32 Lua_Corpse::GetCharID() { Lua_Safe_Call_Int(); - return self->GetCharID(); + return self->getCharacterID(); } uint32 Lua_Corpse::GetDecayTime() { @@ -19,17 +19,17 @@ uint32 Lua_Corpse::GetDecayTime() { void Lua_Corpse::Lock() { Lua_Safe_Call_Void(); - self->Lock(); + self->lock(); } void Lua_Corpse::UnLock() { Lua_Safe_Call_Void(); - self->UnLock(); + self->unlock(); } bool Lua_Corpse::IsLocked() { Lua_Safe_Call_Bool(); - return self->IsLocked(); + return self->isLocked(); } void Lua_Corpse::ResetLooter() { @@ -44,7 +44,7 @@ uint32 Lua_Corpse::GetDBID() { bool Lua_Corpse::IsRezzed() { Lua_Safe_Call_Bool(); - return self->Rezzed(); + return self->isResurrected(); } const char* Lua_Corpse::GetOwnerName() { @@ -74,7 +74,7 @@ void Lua_Corpse::Depop() { uint32 Lua_Corpse::CountItems() { Lua_Safe_Call_Int(); - return self->CountItems(); + return self->getNumItems(); } void Lua_Corpse::AddItem(uint32 itemnum, uint16 charges, int16 slot, uint32 aug1, uint32 aug2, uint32 aug3, uint32 aug4, uint32 aug5) { @@ -94,12 +94,12 @@ void Lua_Corpse::RemoveItem(uint16 lootslot) { void Lua_Corpse::SetCash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) { Lua_Safe_Call_Void(); - self->SetCash(copper, silver, gold, platinum); + self->setCash(copper, silver, gold, platinum); } void Lua_Corpse::RemoveCash() { Lua_Safe_Call_Void(); - self->RemoveCash(); + self->removeCash(); } bool Lua_Corpse::IsEmpty() { @@ -114,12 +114,12 @@ void Lua_Corpse::SetDecayTimer(uint32 decaytime) { bool Lua_Corpse::CanMobLoot(int charid) { Lua_Safe_Call_Bool(); - return self->CanMobLoot(charid); + return self->canMobLoot(charid); } void Lua_Corpse::AllowMobLoot(Lua_Mob them, uint8 slot) { Lua_Safe_Call_Void(); - self->AllowMobLoot(them, slot); + self->addLooter(them, slot); } bool Lua_Corpse::Summon(Lua_Client client, bool spell, bool checkdistance) { @@ -129,27 +129,27 @@ bool Lua_Corpse::Summon(Lua_Client client, bool spell, bool checkdistance) { uint32 Lua_Corpse::GetCopper() { Lua_Safe_Call_Int(); - return self->GetCopper(); + return self->getCopper(); } uint32 Lua_Corpse::GetSilver() { Lua_Safe_Call_Int(); - return self->GetSilver(); + return self->getSilver(); } uint32 Lua_Corpse::GetGold() { Lua_Safe_Call_Int(); - return self->GetGold(); + return self->getGold(); } uint32 Lua_Corpse::GetPlatinum() { Lua_Safe_Call_Int(); - return self->GetPlatinum(); + return self->getPlatinum(); } void Lua_Corpse::AddLooter(Lua_Mob who) { Lua_Safe_Call_Void(); - self->AddLooter(who); + self->addLooter(who); } luabind::scope lua_register_corpse() { diff --git a/zone/lua_general.cpp b/zone/lua_general.cpp index cfe21dc51..d3a49b1a5 100644 --- a/zone/lua_general.cpp +++ b/zone/lua_general.cpp @@ -376,16 +376,16 @@ void lua_toggle_spawn_event(int event_id, bool enable, bool strict, bool reset) quest_manager.toggle_spawn_event(event_id, enable, strict, reset); } -void lua_summon_burried_player_corpse(uint32 char_id, float x, float y, float z, float h) { - quest_manager.summonburriedplayercorpse(char_id, x, y, z, h); +void lua_summon_buried_player_corpse(uint32 char_id, float x, float y, float z, float h) { + quest_manager.summonburiedplayercorpse(char_id, x, y, z, h); } void lua_summon_all_player_corpses(uint32 char_id, float x, float y, float z, float h) { quest_manager.summonallplayercorpses(char_id, x, y, z, h); } -int lua_get_player_burried_corpse_count(uint32 char_id) { - return quest_manager.getplayerburriedcorpsecount(char_id); +int lua_get_player_buried_corpse_count(uint32 char_id) { + return quest_manager.getplayerburiedcorpsecount(char_id); } bool lua_bury_player_corpse(uint32 char_id) { @@ -1208,9 +1208,9 @@ luabind::scope lua_register_general() { luabind::def("spawn_condition", &lua_spawn_condition), luabind::def("get_spawn_condition", &lua_get_spawn_condition), luabind::def("toggle_spawn_event", &lua_toggle_spawn_event), - luabind::def("summon_burried_player_corpse", &lua_summon_burried_player_corpse), + luabind::def("summon_buried_player_corpse", &lua_summon_buried_player_corpse), luabind::def("summon_all_player_corpses", &lua_summon_all_player_corpses), - luabind::def("get_player_burried_corpse_count", &lua_get_player_burried_corpse_count), + luabind::def("get_player_buried_corpse_count", &lua_get_player_buried_corpse_count), luabind::def("bury_player_corpse", &lua_bury_player_corpse), luabind::def("task_selector", &lua_task_selector), luabind::def("task_set_selector", &lua_task_set_selector), diff --git a/zone/merc.cpp b/zone/merc.cpp index a35cfce17..761f2c54d 100644 --- a/zone/merc.cpp +++ b/zone/merc.cpp @@ -4385,7 +4385,7 @@ Corpse* Merc::GetGroupMemberCorpse() { if(g->members[i] && g->members[i]->IsClient()) { corpse = entity_list.GetCorpseByOwnerWithinRange(g->members[i]->CastToClient(), this, RuleI(Mercs, ResurrectRadius)); - if(corpse && !corpse->Rezzed()) { + if(corpse && !corpse->isResurrected()) { return corpse; } } diff --git a/zone/mob.cpp b/zone/mob.cpp index b0c41d176..f90e9c178 100644 --- a/zone/mob.cpp +++ b/zone/mob.cpp @@ -1243,7 +1243,7 @@ void Mob::ShowStats(Client* client) } else if (IsCorpse()) { if (IsPlayerCorpse()) { - client->Message(0, " CharID: %i PlayerCorpse: %i", CastToCorpse()->GetCharID(), CastToCorpse()->GetDBID()); + client->Message(0, " CharID: %i PlayerCorpse: %i", CastToCorpse()->getCharacterID(), CastToCorpse()->GetDBID()); } else { client->Message(0, " NPCCorpse", GetID()); diff --git a/zone/perl_PlayerCorpse.cpp b/zone/perl_PlayerCorpse.cpp index 366299ea2..0d5133134 100644 --- a/zone/perl_PlayerCorpse.cpp +++ b/zone/perl_PlayerCorpse.cpp @@ -41,15 +41,15 @@ #endif -XS(XS_Corpse_GetCharID); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetCharID) +XS(XS_Corpse_getCharacterID); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_getCharacterID) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::GetCharID(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::getCharacterID(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -61,7 +61,7 @@ XS(XS_Corpse_GetCharID) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetCharID(); + RETVAL = THIS->getCharacterID(); XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); @@ -75,7 +75,7 @@ XS(XS_Corpse_GetDecayTime) Perl_croak(aTHX_ "Usage: Corpse::GetDecayTime(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -93,12 +93,12 @@ XS(XS_Corpse_GetDecayTime) XSRETURN(1); } -XS(XS_Corpse_Lock); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_Lock) +XS(XS_Corpse_lock); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_lock) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::Lock(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::lock(THIS)"); { Corpse * THIS; @@ -111,17 +111,17 @@ XS(XS_Corpse_Lock) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->Lock(); + THIS->lock(); } XSRETURN_EMPTY; } -XS(XS_Corpse_UnLock); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_UnLock) +XS(XS_Corpse_unlock); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_unlock) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::UnLock(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::unlock(THIS)"); { Corpse * THIS; @@ -134,20 +134,20 @@ XS(XS_Corpse_UnLock) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->UnLock(); + THIS->unlock(); } XSRETURN_EMPTY; } -XS(XS_Corpse_IsLocked); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_IsLocked) +XS(XS_Corpse_isLocked); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_isLocked) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::IsLocked(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::isLocked(THIS)"); { Corpse * THIS; - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -158,7 +158,7 @@ XS(XS_Corpse_IsLocked) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->IsLocked(); + RETVAL = THIS->isLocked(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } @@ -196,7 +196,7 @@ XS(XS_Corpse_GetDBID) Perl_croak(aTHX_ "Usage: Corpse::GetDBID(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -222,7 +222,7 @@ XS(XS_Corpse_GetOwnerName) Perl_croak(aTHX_ "Usage: Corpse::GetOwnerName(THIS)"); { Corpse * THIS; - char * RETVAL; + char * RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -248,7 +248,7 @@ XS(XS_Corpse_SetDecayTimer) Perl_croak(aTHX_ "Usage: Corpse::SetDecayTimer(THIS, decaytime)"); { Corpse * THIS; - uint32 decaytime = (uint32)SvUV(ST(1)); + uint32 decaytime = (uint32)SvUV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -272,7 +272,7 @@ XS(XS_Corpse_IsEmpty) Perl_croak(aTHX_ "Usage: Corpse::IsEmpty(THIS)"); { Corpse * THIS; - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -298,9 +298,9 @@ XS(XS_Corpse_AddItem) Perl_croak(aTHX_ "Usage: Corpse::AddItem(THIS, itemnum, charges, slot= 0)"); { Corpse * THIS; - uint32 itemnum = (uint32)SvUV(ST(1)); - uint16 charges = (uint16)SvUV(ST(2)); - int16 slot; + uint32 itemnum = (uint32)SvUV(ST(1)); + uint16 charges = (uint16)SvUV(ST(2)); + int16 slot; if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -330,9 +330,9 @@ XS(XS_Corpse_GetWornItem) Perl_croak(aTHX_ "Usage: Corpse::GetWornItem(THIS, equipSlot)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; - int16 equipSlot = (int16)SvIV(ST(1)); + int16 equipSlot = (int16)SvIV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -373,18 +373,18 @@ XS(XS_Corpse_RemoveItem) XSRETURN_EMPTY; } -XS(XS_Corpse_SetCash); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_SetCash) +XS(XS_Corpse_setCash); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_setCash) { dXSARGS; if (items != 5) - Perl_croak(aTHX_ "Usage: Corpse::SetCash(THIS, in_copper, in_silver, in_gold, in_platinum)"); + Perl_croak(aTHX_ "Usage: Corpse::setCash(THIS, in_copper, in_silver, in_gold, in_platinum)"); { Corpse * THIS; - uint16 in_copper = (uint16)SvUV(ST(1)); - uint16 in_silver = (uint16)SvUV(ST(2)); - uint16 in_gold = (uint16)SvUV(ST(3)); - uint16 in_platinum = (uint16)SvUV(ST(4)); + uint16 in_copper = (uint16)SvUV(ST(1)); + uint16 in_silver = (uint16)SvUV(ST(2)); + uint16 in_gold = (uint16)SvUV(ST(3)); + uint16 in_platinum = (uint16)SvUV(ST(4)); if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -395,17 +395,17 @@ XS(XS_Corpse_SetCash) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->SetCash(in_copper, in_silver, in_gold, in_platinum); + THIS->setCash(in_copper, in_silver, in_gold, in_platinum); } XSRETURN_EMPTY; } -XS(XS_Corpse_RemoveCash); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_RemoveCash) +XS(XS_Corpse_removeCash); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_removeCash) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::RemoveCash(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::removeCash(THIS)"); { Corpse * THIS; @@ -418,20 +418,20 @@ XS(XS_Corpse_RemoveCash) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->RemoveCash(); + THIS->removeCash(); } XSRETURN_EMPTY; } -XS(XS_Corpse_CountItems); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CountItems) +XS(XS_Corpse_getNumItems); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_getNumItems) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::CountItems(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::getNumItems(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -443,7 +443,7 @@ XS(XS_Corpse_CountItems) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->CountItems(); + RETVAL = THIS->getNumItems(); XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); @@ -472,15 +472,15 @@ XS(XS_Corpse_Delete) XSRETURN_EMPTY; } -XS(XS_Corpse_GetCopper); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetCopper) +XS(XS_Corpse_getCopper); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_getCopper) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::GetCopper(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::getCopper(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -492,21 +492,21 @@ XS(XS_Corpse_GetCopper) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetCopper(); + RETVAL = THIS->getCopper(); XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); } -XS(XS_Corpse_GetSilver); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetSilver) +XS(XS_Corpse_getSilver); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_getSilver) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::GetSilver(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::getSilver(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -518,21 +518,21 @@ XS(XS_Corpse_GetSilver) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetSilver(); + RETVAL = THIS->getSilver(); XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); } -XS(XS_Corpse_GetGold); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetGold) +XS(XS_Corpse_getGold); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_getGold) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::GetGold(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::getGold(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -544,21 +544,21 @@ XS(XS_Corpse_GetGold) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetGold(); + RETVAL = THIS->getGold(); XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); } -XS(XS_Corpse_GetPlatinum); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_GetPlatinum) +XS(XS_Corpse_getPlatinum); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_getPlatinum) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::GetPlatinum(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::getPlatinum(THIS)"); { Corpse * THIS; - uint32 RETVAL; + uint32 RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Corpse")) { @@ -570,7 +570,7 @@ XS(XS_Corpse_GetPlatinum) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->GetPlatinum(); + RETVAL = THIS->getPlatinum(); XSprePUSH; PUSHu((UV)RETVAL); } XSRETURN(1); @@ -584,8 +584,8 @@ XS(XS_Corpse_Summon) Perl_croak(aTHX_ "Usage: Corpse::Summon(THIS, client, spell)"); { Corpse * THIS; - Client* client; - bool spell = (bool)SvTRUE(ST(2)); + Client* client; + bool spell = (bool)SvTRUE(ST(2)); if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -610,16 +610,16 @@ XS(XS_Corpse_Summon) XSRETURN_EMPTY; } -XS(XS_Corpse_CastRezz); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CastRezz) +XS(XS_Corpse_CastResurrection); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_CastResurrection) { dXSARGS; if (items != 3) - Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, spellid, Caster)"); + Perl_croak(aTHX_ "Usage: Corpse::CastResurrection(THIS, spellid, Caster)"); { Corpse * THIS; - uint16 spellid = (uint16)SvUV(ST(1)); - Mob* Caster; + uint16 spellid = (uint16)SvUV(ST(1)); + Mob* Caster; if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -639,17 +639,17 @@ XS(XS_Corpse_CastRezz) if(Caster == nullptr) Perl_croak(aTHX_ "Caster is nullptr, avoiding crash."); - THIS->CastRezz(spellid, Caster); + THIS->CastResurrection(spellid, Caster); } XSRETURN_EMPTY; } -XS(XS_Corpse_CompleteRezz); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CompleteRezz) +XS(XS_Corpse_CompleteResurrection); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_CompleteResurrection) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::CompleteRezz(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::CompleteResurrection(THIS)"); { Corpse * THIS; @@ -662,21 +662,21 @@ XS(XS_Corpse_CompleteRezz) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - THIS->CompleteRezz(); + THIS->CompleteResurrection(); } XSRETURN_EMPTY; } -XS(XS_Corpse_CanMobLoot); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_CanMobLoot) +XS(XS_Corpse_canMobLoot); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_canMobLoot) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, charid)"); + Perl_croak(aTHX_ "Usage: Corpse::canMobLoot(THIS, charid)"); { Corpse * THIS; - bool RETVAL; - int charid = (int)SvIV(ST(1)); + bool RETVAL; + int charid = (int)SvIV(ST(1)); if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -687,7 +687,7 @@ XS(XS_Corpse_CanMobLoot) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->CanMobLoot(charid); + RETVAL = THIS->canMobLoot(charid); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } @@ -702,8 +702,8 @@ XS(XS_Corpse_AllowMobLoot) Perl_croak(aTHX_ "Usage: Corpse::AllowMobLoot(THIS, them, slot)"); { Corpse * THIS; - Mob * them; - uint8 slot = (uint8)SvUV(ST(2)); + Mob * them; + uint8 slot = (uint8)SvUV(ST(2)); if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -728,15 +728,15 @@ XS(XS_Corpse_AllowMobLoot) XSRETURN_EMPTY; } -XS(XS_Corpse_AddLooter); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_AddLooter) +XS(XS_Corpse_addLooter); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_addLooter) { dXSARGS; if (items != 2) - Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, who)"); + Perl_croak(aTHX_ "Usage: Corpse::addLooter(THIS, who)"); { Corpse * THIS; - Mob * who; + Mob * who; if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -756,20 +756,20 @@ XS(XS_Corpse_AddLooter) if(who == nullptr) Perl_croak(aTHX_ "who is nullptr, avoiding crash."); - THIS->AddLooter(who); + THIS->addLooter(who); } XSRETURN_EMPTY; } -XS(XS_Corpse_IsRezzed); /* prototype to pass -Wmissing-prototypes */ -XS(XS_Corpse_IsRezzed) +XS(XS_Corpse_isResurrected); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_isResurrected) { dXSARGS; if (items != 1) - Perl_croak(aTHX_ "Usage: Corpse::IsRezzed(THIS)"); + Perl_croak(aTHX_ "Usage: Corpse::isResurrected(THIS)"); { Corpse * THIS; - bool RETVAL; + bool RETVAL; if (sv_derived_from(ST(0), "Corpse")) { IV tmp = SvIV((SV*)SvRV(ST(0))); @@ -780,13 +780,37 @@ XS(XS_Corpse_IsRezzed) if(THIS == nullptr) Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); - RETVAL = THIS->Rezzed(); + RETVAL = THIS->isResurrected(); ST(0) = boolSV(RETVAL); sv_2mortal(ST(0)); } XSRETURN(1); } +XS(XS_Corpse_setResurrected); /* prototype to pass -Wmissing-prototypes */ +XS(XS_Corpse_setResurrected) { + dXSARGS; + if (items != 2) + Perl_croak(aTHX_ "Usage: Corpse::setResurrected(THIS, resurrected)"); + { + Corpse * THIS; + bool resurrected = (bool)SvTRUE(ST(1)); + + if (sv_derived_from(ST(0), "Corpse")) { + IV tmp = SvIV((SV*)SvRV(ST(0))); + THIS = INT2PTR(Corpse *, tmp); + } + else + Perl_croak(aTHX_ "THIS is not of type Corpse"); + if(THIS == nullptr) + Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); + + THIS->setResurrected(resurrected); + } + XSRETURN_EMPTY; +} + + #ifdef __cplusplus extern "C" #endif @@ -806,11 +830,11 @@ XS(boot_Corpse) XS_VERSION_BOOTCHECK ; - newXSproto(strcpy(buf, "GetCharID"), XS_Corpse_GetCharID, file, "$"); + newXSproto(strcpy(buf, "getCharacterID"), XS_Corpse_getCharacterID, file, "$"); newXSproto(strcpy(buf, "GetDecayTime"), XS_Corpse_GetDecayTime, file, "$"); - newXSproto(strcpy(buf, "Lock"), XS_Corpse_Lock, file, "$"); - newXSproto(strcpy(buf, "UnLock"), XS_Corpse_UnLock, file, "$"); - newXSproto(strcpy(buf, "IsLocked"), XS_Corpse_IsLocked, file, "$"); + newXSproto(strcpy(buf, "lock"), XS_Corpse_lock, file, "$"); + newXSproto(strcpy(buf, "unlock"), XS_Corpse_unlock, file, "$"); + newXSproto(strcpy(buf, "isLocked"), XS_Corpse_isLocked, file, "$"); newXSproto(strcpy(buf, "ResetLooter"), XS_Corpse_ResetLooter, file, "$"); newXSproto(strcpy(buf, "GetDBID"), XS_Corpse_GetDBID, file, "$"); newXSproto(strcpy(buf, "GetOwnerName"), XS_Corpse_GetOwnerName, file, "$"); @@ -819,21 +843,21 @@ XS(boot_Corpse) newXSproto(strcpy(buf, "AddItem"), XS_Corpse_AddItem, file, "$$$;$"); newXSproto(strcpy(buf, "GetWornItem"), XS_Corpse_GetWornItem, file, "$$"); newXSproto(strcpy(buf, "RemoveItem"), XS_Corpse_RemoveItem, file, "$$"); - newXSproto(strcpy(buf, "SetCash"), XS_Corpse_SetCash, file, "$$$$$"); - newXSproto(strcpy(buf, "RemoveCash"), XS_Corpse_RemoveCash, file, "$"); - newXSproto(strcpy(buf, "CountItems"), XS_Corpse_CountItems, file, "$"); + newXSproto(strcpy(buf, "setCash"), XS_Corpse_setCash, file, "$$$$$"); + newXSproto(strcpy(buf, "removeCash"), XS_Corpse_removeCash, file, "$"); + newXSproto(strcpy(buf, "getNumItems"), XS_Corpse_getNumItems, file, "$"); newXSproto(strcpy(buf, "Delete"), XS_Corpse_Delete, file, "$"); - newXSproto(strcpy(buf, "GetCopper"), XS_Corpse_GetCopper, file, "$"); - newXSproto(strcpy(buf, "GetSilver"), XS_Corpse_GetSilver, file, "$"); - newXSproto(strcpy(buf, "GetGold"), XS_Corpse_GetGold, file, "$"); - newXSproto(strcpy(buf, "GetPlatinum"), XS_Corpse_GetPlatinum, file, "$"); + newXSproto(strcpy(buf, "getCopper"), XS_Corpse_getCopper, file, "$"); + newXSproto(strcpy(buf, "getSilver"), XS_Corpse_getSilver, file, "$"); + newXSproto(strcpy(buf, "getGold"), XS_Corpse_getGold, file, "$"); + newXSproto(strcpy(buf, "getPlatinum"), XS_Corpse_getPlatinum, file, "$"); newXSproto(strcpy(buf, "Summon"), XS_Corpse_Summon, file, "$$$"); - newXSproto(strcpy(buf, "CastRezz"), XS_Corpse_CastRezz, file, "$$$"); - newXSproto(strcpy(buf, "CompleteRezz"), XS_Corpse_CompleteRezz, file, "$"); - newXSproto(strcpy(buf, "CanMobLoot"), XS_Corpse_CanMobLoot, file, "$$"); - newXSproto(strcpy(buf, "AllowMobLoot"), XS_Corpse_AllowMobLoot, file, "$$$"); - newXSproto(strcpy(buf, "AddLooter"), XS_Corpse_AddLooter, file, "$$"); - newXSproto(strcpy(buf, "IsRezzed"), XS_Corpse_IsRezzed, file, "$"); + newXSproto(strcpy(buf, "CastResurrection"), XS_Corpse_CastResurrection, file, "$$$"); + newXSproto(strcpy(buf, "CompleteResurrection"), XS_Corpse_CompleteResurrection, file, "$"); + newXSproto(strcpy(buf, "canMobLoot"), XS_Corpse_canMobLoot, file, "$$"); + newXSproto(strcpy(buf, "addLooter"), XS_Corpse_addLooter, file, "$$$"); + newXSproto(strcpy(buf, "isResurrected"), XS_Corpse_isResurrected, file, "$"); + newXSproto(strcpy(buf, "setResurrected"), XS_Corpse_setResurrected, file, "$$"); //Number of $ is dependent upon number of arguments needed. XSRETURN_YES; } diff --git a/zone/questmgr.cpp b/zone/questmgr.cpp index 7ddecb919..caf721669 100644 --- a/zone/questmgr.cpp +++ b/zone/questmgr.cpp @@ -1753,11 +1753,11 @@ 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::summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading) { bool Result = false; if(char_id > 0) { - Corpse* PlayerCorpse = database.SummonBurriedPlayerCorpse(char_id, zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading); + Corpse* PlayerCorpse = database.SummonBuriedPlayerCorpse(char_id, zone->GetZoneID(), zone->GetInstanceID(), dest_x, dest_y, dest_z, dest_heading); if(PlayerCorpse) { Result = true; } @@ -1776,11 +1776,11 @@ bool QuestManager::summonallplayercorpses(uint32 char_id, float dest_x, float de return Result; } -uint32 QuestManager::getplayerburriedcorpsecount(uint32 char_id) { +uint32 QuestManager::getplayerburiedcorpsecount(uint32 char_id) { uint32 Result = 0; if(char_id > 0) { - Result = database.GetPlayerBurriedCorpseCount(char_id); + Result = database.GetPlayerBuriedCorpseCount(char_id); } return Result; } diff --git a/zone/questmgr.h b/zone/questmgr.h index e854d6274..d0bc544d1 100644 --- a/zone/questmgr.h +++ b/zone/questmgr.h @@ -155,9 +155,9 @@ public: void set_zone_flag(int zone_id); void clear_zone_flag(int zone_id); void sethp(int hpperc); - bool summonburriedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading); + bool summonburiedplayercorpse(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading); bool summonallplayercorpses(uint32 char_id, float dest_x, float dest_y, float dest_z, float dest_heading); - uint32 getplayerburriedcorpsecount(uint32 char_id); + uint32 getplayerburiedcorpsecount(uint32 char_id); bool buryplayercorpse(uint32 char_id); void forcedooropen(uint32 doorid, bool altmode); void forcedoorclose(uint32 doorid, bool altmode); diff --git a/zone/spell_effects.cpp b/zone/spell_effects.cpp index 4db33f91f..c4ade7923 100644 --- a/zone/spell_effects.cpp +++ b/zone/spell_effects.cpp @@ -1640,10 +1640,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if(caster) - mlog(SPELLS__REZ, " corpse being rezzed using spell %i by %s", + mlog(SPELLS__RESURRECTION, " corpse being resurrected using spell %i by %s", spell_id, caster->GetName()); - CastToCorpse()->CastRezz(spell_id, caster); + CastToCorpse()->CastResurrection(spell_id, caster); } break; } @@ -2438,7 +2438,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial) case SE_SummonAndResAllCorpses: { if(IsClient()) - CastToClient()->SummonAndRezzAllCorpses(); + CastToClient()->SummonAndResurrectAllCorpses(); break; } diff --git a/zone/spells.cpp b/zone/spells.cpp index 196394266..ffd9d3d06 100644 --- a/zone/spells.cpp +++ b/zone/spells.cpp @@ -3654,42 +3654,42 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r return true; } -void Corpse::CastRezz(uint16 spellid, Mob* Caster) +void Corpse::CastResurrection(uint16 spellid, Mob* Caster) { - _log(SPELLS__REZ, "Corpse::CastRezz spellid %i, Rezzed() is %i, rezzexp is %i", spellid,Rezzed(),rezzexp); + _log(SPELLS__RESURRECTION, "Corpse::CastResurrection spellid %i, isResurrected() is %i, resurrectionxp is %i", spellid,isResurrected(),mResurrectionExp); - if(Rezzed()){ + if(isResurrected()){ if(Caster && Caster->IsClient()) Caster->Message(13,"This character has already been resurrected."); return; } /* - if(!can_rez) { + if(!can_resurrect) { if(Caster && Caster->IsClient()) Caster->Message_StringID(0, CORPSE_TOO_OLD); return; } */ - EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); - Resurrect_Struct* rezz = (Resurrect_Struct*) outapp->pBuffer; + EQApplicationPacket* outapp = new EQApplicationPacket(OP_ResurrectionRequest, sizeof(Resurrect_Struct)); + Resurrect_Struct* resurrect = (Resurrect_Struct*) outapp->pBuffer; // Why are we truncating these names to 30 characters ? - memcpy(rezz->your_name,this->orgname,30); - memcpy(rezz->corpse_name,this->name,30); - memcpy(rezz->rezzer_name,Caster->GetName(),30); - rezz->zone_id = zone->GetZoneID(); - rezz->instance_id = zone->GetInstanceID(); - rezz->spellid = spellid; - rezz->x = this->x_pos; - rezz->y = this->y_pos; - rezz->z = this->z_pos; - rezz->unknown000 = 0x00000000; - rezz->unknown020 = 0x00000000; - rezz->unknown088 = 0x00000000; + memcpy(resurrect->your_name,this->orgname,30); + memcpy(resurrect->corpse_name,this->name,30); + memcpy(resurrect->resurrecter_name,Caster->GetName(),30); + resurrect->zone_id = zone->GetZoneID(); + resurrect->instance_id = zone->GetInstanceID(); + resurrect->spellid = spellid; + resurrect->x = this->x_pos; + resurrect->y = this->y_pos; + resurrect->z = this->z_pos; + resurrect->unknown000 = 0x00000000; + resurrect->unknown020 = 0x00000000; + resurrect->unknown088 = 0x00000000; // We send this to world, because it needs to go to the player who may not be in this zone. - worldserver.RezzPlayer(outapp, rezzexp, dbid, OP_RezzRequest); - _pkt(SPELLS__REZ, outapp); + worldserver.ResurrectPlayer(outapp, mResurrectionExp, mDBID, OP_ResurrectionRequest); + _pkt(SPELLS__RESURRECTION, outapp); safe_delete(outapp); } diff --git a/zone/worldserver.cpp b/zone/worldserver.cpp index edadc94f3..203c0ce02 100644 --- a/zone/worldserver.cpp +++ b/zone/worldserver.cpp @@ -655,64 +655,64 @@ void WorldServer::Process() { else if (sus->status == 1) petition_list.ReadDatabase(); // Until I fix this to be better.... break; } - case ServerOP_RezzPlayer: { - RezzPlayer_Struct* srs = (RezzPlayer_Struct*) pack->pBuffer; - if (srs->rezzopcode == OP_RezzRequest) + case ServerOP_ResurrectPlayer: { + ResurrectPlayer_Struct* srs = (ResurrectPlayer_Struct*) pack->pBuffer; + if (srs->resurrectionopcode == OP_ResurrectionRequest) { - // The Rezz request has arrived in the zone the player to be rezzed is currently in, + // The resurrection request has arrived in the zone the player to be resurrected is currently in, // so we send the request to their client which will bring up the confirmation box. - Client* client = entity_list.GetClientByName(srs->rez.your_name); + Client* client = entity_list.GetClientByName(srs->resurrect.your_name); if (client) { - if(client->IsRezzPending()) + if(client->IsResurrectionPending()) { - ServerPacket * Response = new ServerPacket(ServerOP_RezzPlayerReject, strlen(srs->rez.rezzer_name) + 1); + ServerPacket * Response = new ServerPacket(ServerOP_ResurrectPlayerReject, strlen(srs->resurrect.resurrecter_name) + 1); char *Buffer = (char *)Response->pBuffer; - sprintf(Buffer, "%s", srs->rez.rezzer_name); + sprintf(Buffer, "%s", srs->resurrect.resurrecter_name); worldserver.SendPacket(Response); safe_delete(Response); break; } - //pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 - //also serves to inform Client::OPRezzAnswer to expect a packet. - client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); - _log(SPELLS__REZ, "OP_RezzRequest in zone %s for %s, spellid:%i", - zone->GetShortName(), client->GetName(), srs->rez.spellid); - EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, + //pendingmRessurectionExp is the amount of XP on the corpse. Setting it to a value >= 0 + //also serves to inform Client::OPResurrectionAnswer to expect a packet. + client->SetPendingResurrectionData(srs->exp, srs->dbid, srs->resurrect.spellid, srs->resurrect.corpse_name); + _log(SPELLS__RESURRECTION, "OP_ResurrectionRequest in zone %s for %s, spellid:%i", + zone->GetShortName(), client->GetName(), srs->resurrect.spellid); + EQApplicationPacket* outapp = new EQApplicationPacket(OP_ResurrectionRequest, sizeof(Resurrect_Struct)); - memcpy(outapp->pBuffer, &srs->rez, sizeof(Resurrect_Struct)); + memcpy(outapp->pBuffer, &srs->resurrect, sizeof(Resurrect_Struct)); client->QueuePacket(outapp); - _pkt(SPELLS__REZ, outapp); + _pkt(SPELLS__RESURRECTION, outapp); safe_delete(outapp); break; } } - if (srs->rezzopcode == OP_RezzComplete){ - // We get here when the Rezz complete packet has come back via the world server + if (srs->resurrectionopcode == OP_ResurrectionComplete){ + // We get here when the Resurrection complete packet has come back via the world server // to the zone that the corpse is in. - Corpse* corpse = entity_list.GetCorpseByName(srs->rez.corpse_name); + Corpse* corpse = entity_list.GetCorpseByName(srs->resurrect.corpse_name); if (corpse && corpse->IsCorpse()) { - _log(SPELLS__REZ, "OP_RezzComplete received in zone %s for corpse %s", - zone->GetShortName(), srs->rez.corpse_name); + _log(SPELLS__RESURRECTION, "OP_ResurrectionComplete received in zone %s for corpse %s", + zone->GetShortName(), srs->resurrect.corpse_name); - _log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); - // I don't know why Rezzed is not set to true in CompleteRezz(). - corpse->Rezzed(true); - corpse->CompleteRezz(); + _log(SPELLS__RESURRECTION, "Found corpse. Marking corpse as resurrected."); + // I don't know why Resurrected is not set to true in CompleteResurrection(). + corpse->setResurrected(true); + corpse->CompleteResurrection(); } } break; } - case ServerOP_RezzPlayerReject: + case ServerOP_ResurrectPlayerReject: { - char *Rezzer = (char *)pack->pBuffer; + char *Resurrecter = (char *)pack->pBuffer; - Client* c = entity_list.GetClientByName(Rezzer); + Client* c = entity_list.GetClientByName(Resurrecter); if (c) - c->Message_StringID(MT_WornOff, REZZ_ALREADY_PENDING); + c->Message_StringID(MT_WornOff, RESURRECTION_ALREADY_PENDING); break; } @@ -1944,20 +1944,20 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 return Ret; } -bool WorldServer::RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode) +bool WorldServer::ResurrectPlayer(EQApplicationPacket* rpack, uint32 mRessurectionExp, uint32 dbid, uint16 opcode) { - _log(SPELLS__REZ, "WorldServer::RezzPlayer rezzexp is %i (0 is normal for RezzComplete", rezzexp); - ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); - RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; - sem->rezzopcode = opcode; - sem->rez = *(Resurrect_Struct*) rpack->pBuffer; - sem->exp = rezzexp; + _log(SPELLS__RESURRECTION, "WorldServer::ResurrectionPlayer mRessurectionExp is %i (0 is normal for ResurrectionComplete", mRessurectionExp); + ServerPacket* pack = new ServerPacket(ServerOP_ResurrectPlayer, sizeof(ResurrectPlayer_Struct)); + ResurrectPlayer_Struct* sem = (ResurrectPlayer_Struct*) pack->pBuffer; + sem->resurrectionopcode = opcode; + sem->resurrect = *(Resurrect_Struct*) rpack->pBuffer; + sem->exp = mRessurectionExp; sem->dbid = dbid; bool ret = SendPacket(pack); if (ret) - _log(SPELLS__REZ, "Sending player rezz packet to world spellid:%i", sem->rez.spellid); + _log(SPELLS__RESURRECTION, "Sending player resurrection packet to world spellid:%i", sem->resurrect.spellid); else - _log(SPELLS__REZ, "NOT Sending player rezz packet to world"); + _log(SPELLS__RESURRECTION, "NOT Sending player resurrection packet to world"); safe_delete(pack); return ret; diff --git a/zone/worldserver.h b/zone/worldserver.h index 3c2e03fa6..199e22f2a 100644 --- a/zone/worldserver.h +++ b/zone/worldserver.h @@ -41,7 +41,7 @@ public: bool SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 MacroNumber, uint32 GroupOrRaidID = 0); void SetZone(uint32 iZoneID, uint32 iInstanceID = 0); uint32 SendGroupIdRequest(); - bool RezzPlayer(EQApplicationPacket* rpack, uint32 rezzexp, uint32 dbid, uint16 opcode); + bool ResurrectPlayer(EQApplicationPacket* rpack, uint32 mRessurectionExp, uint32 dbid, uint16 opcode); bool IsOOCMuted() const { return(oocmuted); } uint32 NextGroupID(); diff --git a/zone/zonedb.h b/zone/zonedb.h index e53b45530..32807a6e3 100644 --- a/zone/zonedb.h +++ b/zone/zonedb.h @@ -262,13 +262,13 @@ public: bool GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes); uint32 CreatePlayerCorpse(uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading); bool CreatePlayerCorpseBackup(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading); - uint32 UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading, bool rezzed = false); - void MarkCorpseAsRezzed(uint32 dbid); + uint32 UpdatePlayerCorpse(uint32 dbid, uint32 charid, const char* charname, uint32 zoneid, uint16 instanceid, uchar* data, uint32 datasize, float x, float y, float z, float heading, bool isRessurected = false); + void MarkCorpseAsResurrected(uint32 dbid); bool BuryPlayerCorpse(uint32 dbid); bool BuryAllPlayerCorpses(uint32 charid); bool DeletePlayerCorpse(uint32 dbid); - uint32 GetPlayerBurriedCorpseCount(uint32 char_id); - Corpse* SummonBurriedPlayerCorpse(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading); + uint32 GetPlayerBuriedCorpseCount(uint32 char_id); + Corpse* SummonBuriedPlayerCorpse(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading); bool SummonAllPlayerCorpses(uint32 char_id, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading); bool SummonAllGraveyardCorpses(uint32 cur_zoneid, uint32 dest_zoneid, uint16 dest_instanceid, float dest_x, float dest_y, float dest_z, float dest_heading); Corpse* LoadPlayerCorpse(uint32 player_corpse_id);