A lot of corpse changes.

This commit is contained in:
Kinglykrab 2014-06-11 07:36:14 -04:00
parent a164ab6fec
commit 6e5e450054
47 changed files with 1140 additions and 1572 deletions

View File

@ -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);

View File

@ -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),

View File

@ -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;

View File

@ -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 )

View File

@ -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);

View File

@ -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";

View File

@ -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;

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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

View File

@ -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 {

View File

@ -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))
{

View File

@ -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);

View File

@ -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

View File

@ -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);
}
}
}

View File

@ -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.");
}

View File

@ -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<uint32> PlayerBlockedBuffs;
std::set<uint32> PetBlockedBuffs;
@ -1506,5 +1500,4 @@ private:
uint8 initial_respawn_selection;
};
#endif
#endif

File diff suppressed because it is too large Load Diff

View File

@ -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 = "<table><tr><td>Name</td><td>Zone</td><td>X</td><td>Y</td><td>Z</td><td>Date</td><td>"
"Rezzed</td><td>Buried</td></tr><tr><td>&nbsp</td><td></td><td></td><td></td><td></td><td>"
"</td><td></td><td></td></tr>";
std::string PopupText = "<table><tr><td>Name</td><td>Zone</td><td>X</td><td>Y</td><td>Z</td><td>Date</td><td>Resurrected</td><td>Buried</td></tr><tr><td>&nbsp</td><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>";
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, "<tr><td>%s</td><td>%s</td><td>%8.0f</td><td>%8.0f</td><td>%8.0f</td><td>%s</td><td>%s</td><td>%s</td></tr>",
CharName, StaticGetZoneName(ZoneID), CorpseX, CorpseY, CorpseZ, TimeOfDeath,
CorpseRezzed ? "Yes" : "No", CorpseBuried ? "Yes" : "No");
sprintf(Buffer, "<tr><td>%s</td><td>%s</td><td>%8.0f</td><td>%8.0f</td><td>%8.0f</td><td>%s</td><td>%s</td><td>%s</td></tr>", 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 += "</table>";
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);
}

View File

@ -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);

View File

@ -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<std::string>(itoa(Option)), is_rez ? 1 : 0);
parse->EventPlayer(EVENT_RESPAWN, this, static_cast<std::string>(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();

View File

@ -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;
}

View File

@ -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);

View File

@ -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())

File diff suppressed because it is too large Load Diff

View File

@ -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<uint32> 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

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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);

View File

@ -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() {

View File

@ -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),

View File

@ -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;
}
}

View File

@ -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());

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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);

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;

View File

@ -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();

View File

@ -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);