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
+1 -1
View File
@@ -2700,7 +2700,7 @@ void Database::BuryCorpsesInInstance(uint16 instance_id)
char *query = 0; char *query = 0;
MYSQL_RES *result; 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)) instance_id), errbuf, &result))
{ {
mysql_free_result(result); mysql_free_result(result);
+3 -3
View File
@@ -100,8 +100,8 @@ N(OP_Track),
N(OP_ItemLinkClick), N(OP_ItemLinkClick),
N(OP_ItemLinkResponse), N(OP_ItemLinkResponse),
N(OP_ItemLinkText), N(OP_ItemLinkText),
N(OP_RezzAnswer), N(OP_ResurrectionAnswer),
N(OP_RezzComplete), N(OP_ResurrectionComplete),
N(OP_SendZonepoints), N(OP_SendZonepoints),
N(OP_SetRunMode), N(OP_SetRunMode),
N(OP_InspectRequest), N(OP_InspectRequest),
@@ -281,7 +281,7 @@ N(OP_LoginComplete),
N(OP_GMNameChange), N(OP_GMNameChange),
N(OP_ReadBook), N(OP_ReadBook),
N(OP_GMKick), N(OP_GMKick),
N(OP_RezzRequest), N(OP_ResurrectionRequest),
N(OP_MultiLineMsg), N(OP_MultiLineMsg),
N(OP_TimeOfDay), N(OP_TimeOfDay),
N(OP_CompletedTasks), N(OP_CompletedTasks),
+1 -1
View File
@@ -2571,7 +2571,7 @@ struct Resurrect_Struct {
/*020*/ uint32 unknown020; /*020*/ uint32 unknown020;
/*024*/ char your_name[64]; /*024*/ char your_name[64];
/*088*/ uint32 unknown088; /*088*/ uint32 unknown088;
/*092*/ char rezzer_name[64]; /*092*/ char resurrecter_name[64];
/*156*/ uint32 spellid; /*156*/ uint32 spellid;
/*160*/ char corpse_name[64]; /*160*/ char corpse_name[64];
/*224*/ uint32 action; /*224*/ uint32 action;
+1 -1
View File
@@ -95,7 +95,7 @@ LOG_TYPE( SPELLS, BUFFS, DISABLED )
LOG_TYPE( SPELLS, PROCS, DISABLED ) LOG_TYPE( SPELLS, PROCS, DISABLED )
LOG_TYPE( SPELLS, MODIFIERS, DISABLED ) LOG_TYPE( SPELLS, MODIFIERS, DISABLED )
LOG_TYPE( SPELLS, CRITS, DISABLED ) LOG_TYPE( SPELLS, CRITS, DISABLED )
LOG_TYPE( SPELLS, REZ, DISABLED ) LOG_TYPE( SPELLS, RESURRECTION, DISABLED )
LOG_CATEGORY( FACTION ) LOG_CATEGORY( FACTION )
+2 -2
View File
@@ -162,7 +162,7 @@ IN(OP_DeleteItem, DeleteItem_Struct);
IN(OP_CombatAbility, CombatAbility_Struct); IN(OP_CombatAbility, CombatAbility_Struct);
IN(OP_Taunt, ClientTarget_Struct); IN(OP_Taunt, ClientTarget_Struct);
INz(OP_InstillDoubt); INz(OP_InstillDoubt);
IN(OP_RezzAnswer, Resurrect_Struct); IN(OP_ResurrectionAnswer, Resurrect_Struct);
IN(OP_GMSummon, GMSummon_Struct); IN(OP_GMSummon, GMSummon_Struct);
IN(OP_TradeBusy, TradeBusy_Struct); IN(OP_TradeBusy, TradeBusy_Struct);
IN(OP_TradeRequest, TradeRequest_Struct); IN(OP_TradeRequest, TradeRequest_Struct);
@@ -376,7 +376,7 @@ OUT(OP_RandomReply, RandomReply_Struct);
OUT(OP_RecipeReply, RecipeReply_Struct); OUT(OP_RecipeReply, RecipeReply_Struct);
OUT(OP_RequestClientZoneChange, RequestClientZoneChange_Struct); OUT(OP_RequestClientZoneChange, RequestClientZoneChange_Struct);
OUT(OP_RespondAA, AATable_Struct); OUT(OP_RespondAA, AATable_Struct);
OUT(OP_RezzRequest, Resurrect_Struct); OUT(OP_ResurrectionRequest, Resurrect_Struct);
OUT(OP_SetTitleReply, SetTitleReply_Struct); OUT(OP_SetTitleReply, SetTitleReply_Struct);
OUT(OP_ShopDelItem, Merchant_DelItem_Struct); OUT(OP_ShopDelItem, Merchant_DelItem_Struct);
OUT(OP_SimpleMessage, SimpleMessage_Struct); OUT(OP_SimpleMessage, SimpleMessage_Struct);
+3 -3
View File
@@ -119,9 +119,9 @@ void load_opcode_names()
opcode_map[0x001f]="LiveOP_ItemLinkClick"; opcode_map[0x001f]="LiveOP_ItemLinkClick";
opcode_map[0x01f4]="LiveOP_ItemLinkResponse"; opcode_map[0x01f4]="LiveOP_ItemLinkResponse";
opcode_map[0x01d9]="LiveOP_ItemLinkText"; opcode_map[0x01d9]="LiveOP_ItemLinkText";
opcode_map[0x0a41]="LiveOP_RezzRequest"; opcode_map[0x0a41]="LiveOP_ResurrectionRequest";
opcode_map[0x00e5]="LiveOP_RezzAnswer"; opcode_map[0x00e5]="LiveOP_ResurrectionAnswer";
opcode_map[0x019b]="LiveOP_RezzComplete"; opcode_map[0x019b]="LiveOP_ResurrectionComplete";
opcode_map[0x0128]="LiveOP_MoveDoor"; opcode_map[0x0128]="LiveOP_MoveDoor";
opcode_map[0x0127]="LiveOP_ClickDoor"; opcode_map[0x0127]="LiveOP_ClickDoor";
opcode_map[0x0247]="LiveOP_SendZonepoints"; opcode_map[0x0247]="LiveOP_SendZonepoints";
+1 -1
View File
@@ -2043,7 +2043,7 @@ struct Resurrect_Struct {
float z; float z;
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char resurrecter_name[64];
uint32 spellid; uint32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
+4 -4
View File
@@ -4003,7 +4003,7 @@ ENCODE(OP_BeginCast)
FINISH_ENCODE(); FINISH_ENCODE();
} }
ENCODE(OP_RezzRequest) ENCODE(OP_ResurrectionRequest)
{ {
SETUP_DIRECT_ENCODE(Resurrect_Struct, structs::Resurrect_Struct); SETUP_DIRECT_ENCODE(Resurrect_Struct, structs::Resurrect_Struct);
@@ -4013,7 +4013,7 @@ ENCODE(OP_RezzRequest)
OUT(x); OUT(x);
OUT(z); OUT(z);
OUT_str(your_name); OUT_str(your_name);
OUT_str(rezzer_name); OUT_str(resurrecter_name);
OUT(spellid); OUT(spellid);
OUT_str(corpse_name); OUT_str(corpse_name);
OUT(action); OUT(action);
@@ -4817,7 +4817,7 @@ DECODE(OP_GuildStatus)
FINISH_DIRECT_DECODE(); FINISH_DIRECT_DECODE();
} }
DECODE(OP_RezzAnswer) DECODE(OP_ResurrectionAnswer)
{ {
DECODE_LENGTH_EXACT(structs::Resurrect_Struct); DECODE_LENGTH_EXACT(structs::Resurrect_Struct);
SETUP_DIRECT_DECODE(Resurrect_Struct, structs::Resurrect_Struct); SETUP_DIRECT_DECODE(Resurrect_Struct, structs::Resurrect_Struct);
@@ -4828,7 +4828,7 @@ DECODE(OP_RezzAnswer)
IN(x); IN(x);
IN(z); IN(z);
memcpy(emu->your_name, eq->your_name, sizeof(emu->your_name)); 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); IN(spellid);
memcpy(emu->corpse_name, eq->corpse_name, sizeof(emu->corpse_name)); memcpy(emu->corpse_name, eq->corpse_name, sizeof(emu->corpse_name));
IN(action); IN(action);
+2 -2
View File
@@ -100,7 +100,7 @@ E(OP_MercenaryDataResponse)
E(OP_GuildMemberUpdate) E(OP_GuildMemberUpdate)
E(OP_GMLastName) E(OP_GMLastName)
E(OP_BeginCast) E(OP_BeginCast)
E(OP_RezzRequest) E(OP_ResurrectionRequest)
//list of packets we need to decode on the way in: //list of packets we need to decode on the way in:
D(OP_SetServerFilter) D(OP_SetServerFilter)
D(OP_CharacterCreate) D(OP_CharacterCreate)
@@ -157,6 +157,6 @@ D(OP_GuildRemove)
D(OP_GuildStatus) D(OP_GuildStatus)
D(OP_Trader) D(OP_Trader)
D(OP_GMLastName) D(OP_GMLastName)
D(OP_RezzAnswer) D(OP_ResurrectionAnswer)
#undef E #undef E
#undef D #undef D
+1 -1
View File
@@ -2807,7 +2807,7 @@ struct Resurrect_Struct
/*020*/ uint32 unknown020; /*020*/ uint32 unknown020;
/*024*/ char your_name[64]; /*024*/ char your_name[64];
/*088*/ uint32 unknown088; /*088*/ uint32 unknown088;
/*092*/ char rezzer_name[64]; /*092*/ char resurrecter_name[64];
/*156*/ uint32 spellid; /*156*/ uint32 spellid;
/*160*/ char corpse_name[64]; /*160*/ char corpse_name[64];
/*224*/ uint32 action; /*224*/ uint32 action;
+1 -1
View File
@@ -2461,7 +2461,7 @@ struct Resurrect_Struct {
float z; float z;
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char resurrecter_name[64];
uint32 spellid; uint32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
+1 -1
View File
@@ -2395,7 +2395,7 @@ struct Resurrect_Struct {
float z; float z;
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char resurrecter_name[64];
uint32 spellid; uint32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
+1 -1
View File
@@ -2090,7 +2090,7 @@ struct Resurrect_Struct {
float z; float z;
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char resurrecter_name[64];
uint32 spellid; uint32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
+1 -1
View File
@@ -2500,7 +2500,7 @@ struct Resurrect_Struct {
float z; float z;
char your_name[64]; char your_name[64];
uint32 unknown88; uint32 unknown88;
char rezzer_name[64]; char resurrecter_name[64];
uint32 spellid; uint32 spellid;
char corpse_name[64]; char corpse_name[64];
uint32 action; uint32 action;
+1
View File
@@ -313,6 +313,7 @@ RULE_BOOL ( Spells, FocusCombatProcs, false) //Allow all combat procs to receive
RULE_CATEGORY_END() RULE_CATEGORY_END()
RULE_CATEGORY( Combat ) 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, 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, 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 RULE_INT ( Combat, BerserkBaseCritChance, 6 ) //The bonus base crit chance you get when you're berserk
+6 -6
View File
@@ -45,7 +45,7 @@
#define ServerOP_Petition 0x001E #define ServerOP_Petition 0x001E
#define ServerOP_KillPlayer 0x001F #define ServerOP_KillPlayer 0x001F
#define ServerOP_UpdateGM 0x0020 #define ServerOP_UpdateGM 0x0020
#define ServerOP_RezzPlayer 0x0021 #define ServerOP_ResurrectPlayer 0x0021
#define ServerOP_ZoneReboot 0x0022 #define ServerOP_ZoneReboot 0x0022
#define ServerOP_ZoneToZoneRequest 0x0023 #define ServerOP_ZoneToZoneRequest 0x0023
#define ServerOP_AcceptWorldEntrance 0x0024 #define ServerOP_AcceptWorldEntrance 0x0024
@@ -63,11 +63,11 @@
#define ServerOP_GroupIDReq 0x0030 #define ServerOP_GroupIDReq 0x0030
#define ServerOP_GroupIDReply 0x0031 #define ServerOP_GroupIDReply 0x0031
#define ServerOP_GroupLeave 0x0032 // for disbanding out of zone folks #define ServerOP_GroupLeave 0x0032 // for disbanding out of zone folks
#define ServerOP_RezzPlayerAccept 0x0033 #define ServerOP_ResurrectPlayerAccept 0x0033
#define ServerOP_SpawnCondition 0x0034 #define ServerOP_SpawnCondition 0x0034
#define ServerOP_SpawnEvent 0x0035 #define ServerOP_SpawnEvent 0x0035
#define ServerOP_SetLaunchName 0x0036 #define ServerOP_SetLaunchName 0x0036
#define ServerOP_RezzPlayerReject 0x0037 #define ServerOP_ResurrectPlayerReject 0x0037
#define ServerOP_SpawnPlayerCorpse 0x0038 #define ServerOP_SpawnPlayerCorpse 0x0038
#define ServerOP_Consent 0x0039 #define ServerOP_Consent 0x0039
#define ServerOP_Consent_Response 0x003a #define ServerOP_Consent_Response 0x003a
@@ -412,12 +412,12 @@ struct ServerZonePlayer_Struct {
float z_pos; float z_pos;
}; };
struct RezzPlayer_Struct { struct ResurrectPlayer_Struct {
uint32 dbid; uint32 dbid;
uint32 exp; uint32 exp;
uint16 rezzopcode; uint16 resurrectionopcode;
//char packet[160]; //char packet[160];
Resurrect_Struct rez; Resurrect_Struct resurrect;
}; };
struct ServerZoneReboot_Struct { struct ServerZoneReboot_Struct {
+1 -1
View File
@@ -1355,7 +1355,7 @@ int32 SharedDatabase::DeleteStalePlayerCorpses() {
if(RuleB(Zone, EnableShadowrest)) 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", "(UNIX_TIMESTAMP() - UNIX_TIMESTAMP(timeofdeath)) > %d and not timeofdeath=0",
(RuleI(Character, CorpseDecayTimeMS) / 1000)), errbuf, 0, &affected_rows)) (RuleI(Character, CorpseDecayTimeMS) / 1000)), errbuf, 0, &affected_rows))
{ {
+6 -6
View File
@@ -517,22 +517,22 @@ bool ZoneServer::Process() {
break; break;
} }
case ServerOP_RezzPlayerAccept: { case ServerOP_ResurrectPlayerAccept: {
zoneserver_list.SendPacket(pack); zoneserver_list.SendPacket(pack);
break; 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)){ 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 { 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; break;
} }
case ServerOP_RezzPlayerReject: case ServerOP_ResurrectPlayerReject:
{ {
char *Recipient = (char *)pack->pBuffer; char *Recipient = (char *)pack->pBuffer;
client_list.SendPacket(Recipient, pack); client_list.SendPacket(Recipient, pack);
+2 -2
View File
@@ -91,7 +91,7 @@
#define MISSING_SPELL_COMP 272 //You are missing some required spell components. #define MISSING_SPELL_COMP 272 //You are missing some required spell components.
#define INVIS_BEGIN_BREAK 275 //You feel yourself starting to appear. #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 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 DUP_LORE 290 //Duplicate lore items are not allowed.
#define TGB_ON 293 //Target other group buff is *ON*. #define TGB_ON 293 //Target other group buff is *ON*.
#define TGB_OFF 294 //Target other group buff is *OFF*. #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_ACCEPTED 1384 //%1 has already accepted a duel with someone else.
#define DUEL_CONSIDERING 1385 //%1 is considering 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 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 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 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 #define MEMBER_OF_YOUR_GUILD 1429
+6 -6
View File
@@ -1647,14 +1647,14 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
database.GetVariable("PvPitem", tmp2, 9); database.GetVariable("PvPitem", tmp2, 9);
int pvpitem = atoi(tmp2); int pvpitem = atoi(tmp2);
if(pvpitem>0 && pvpitem<200000) if(pvpitem>0 && pvpitem<200000)
new_corpse->SetPKItem(pvpitem); new_corpse->setPKItem(pvpitem);
} }
else if(reward==2) else if(reward==2)
new_corpse->SetPKItem(-1); new_corpse->setPKItem(-1);
else if(reward==1) else if(reward==1)
new_corpse->SetPKItem(1); new_corpse->setPKItem(1);
else else
new_corpse->SetPKItem(0); new_corpse->setPKItem(0);
if(killerMob->CastToClient()->isgrouped) { if(killerMob->CastToClient()->isgrouped) {
Group* group = entity_list.GetGroupByClient(killerMob->CastToClient()); Group* group = entity_list.GetGroupByClient(killerMob->CastToClient());
if(group != 0) if(group != 0)
@@ -1663,7 +1663,7 @@ bool Client::Death(Mob* killerMob, int32 damage, uint16 spell, SkillUseTypes att
{ {
if(group->members[i] != nullptr) 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) { if(group != 0) {
for(int i=0;i<6;i++) { // Doesnt work right, needs work for(int i=0;i<6;i++) { // Doesnt work right, needs work
if(group->members[i] != nullptr) { if(group->members[i] != nullptr) {
corpse->AllowMobLoot(group->members[i],i); corpse->AllowMobLoot(group->members[i], i);
} }
} }
} }
+22 -22
View File
@@ -232,9 +232,9 @@ Client::Client(EQStreamInterface* ieqs)
// initialise haste variable // initialise haste variable
m_tradeskill_object = nullptr; m_tradeskill_object = nullptr;
delaytimer = false; delaytimer = false;
PendingRezzXP = -1; PendingResurrectionXP = -1;
PendingRezzDBID = 0; PendingResurrectionDBID = 0;
PendingRezzSpellID = 0; PendingResurrectionSpellID = 0;
numclients++; numclients++;
// emuerror; // emuerror;
UpdateWindowTitle(); 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); database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Looting Item",logtext,4);
} }
else{ 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)); 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; logtext=coinloot;
strcat(logtext," Looted"); 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); database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Excessive Loot!",logtext,9);
else else
database.logevents(player->AccountName(),player->AccountID(),player->admin,player->GetName(),corpse->orgname,"Looting Money",logtext,5); 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 // 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()) if (respawn_options.empty())
{ {
BindStruct* b = &m_pp.binds[0]; BindStruct* b = &m_pp.binds[0];
@@ -4447,15 +4447,15 @@ void Client::SendRespawnBinds()
opt.heading = b->heading; opt.heading = b->heading;
respawn_options.push_front(opt); respawn_options.push_front(opt);
} }
//Rez is always added at the end //Resurrection is always added at the end
RespawnOption rez; RespawnOption resurrect;
rez.name = "Resurrect"; resurrect.name = "Resurrect";
rez.zoneid = zone->GetZoneID(); resurrect.zoneid = zone->GetZoneID();
rez.x = GetX(); resurrect.x = GetX();
rez.y = GetY(); resurrect.y = GetY();
rez.z = GetZ(); resurrect.z = GetZ();
rez.heading = GetHeading(); resurrect.heading = GetHeading();
respawn_options.push_back(rez); respawn_options.push_back(resurrect);
int num_options = respawn_options.size(); int num_options = respawn_options.size();
uint32 PacketLength = 17 + (26 * num_options); //Header size + per-option invariant 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->z);
VARSTRUCT_ENCODE_TYPE(float, buffer, opt->heading); VARSTRUCT_ENCODE_TYPE(float, buffer, opt->heading);
VARSTRUCT_ENCODE_STRING(buffer, opt->name.c_str()); 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); QueuePacket(outapp);
@@ -4730,9 +4730,9 @@ int Client::LDoNChest_SkillCheck(NPC *target, int skill)
return 0; return 0;
} }
void Client::SummonAndRezzAllCorpses() void Client::SummonAndResurrectAllCorpses()
{ {
PendingRezzXP = -1; PendingResurrectionXP = -1;
ServerPacket *Pack = new ServerPacket(ServerOP_DepopAllPlayersCorpses, sizeof(ServerDepopAllPlayersCorpses_Struct)); ServerPacket *Pack = new ServerPacket(ServerOP_DepopAllPlayersCorpses, sizeof(ServerDepopAllPlayersCorpses_Struct));
@@ -4756,10 +4756,10 @@ void Client::SummonAndRezzAllCorpses()
return; return;
} }
int RezzExp = entity_list.RezzAllCorpsesByCharID(CharacterID()); int ResurrectionExp = entity_list.ResurrectAllCorpsesByCharID(CharacterID());
if(RezzExp > 0) if(ResurrectionExp > 0)
SetEXP(GetEXP() + RezzExp, GetAAXP(), true); SetEXP(GetEXP() + ResurrectionExp, GetAAXP(), true);
Message(clientMessageYellow, "All your corpses have been summoned to your feet and have received a 100% resurrection."); Message(clientMessageYellow, "All your corpses have been summoned to your feet and have received a 100% resurrection.");
} }
+14 -21
View File
@@ -214,8 +214,7 @@ public:
//abstract virtual function implementations requird by base abstract class //abstract virtual function implementations requird by base abstract class
virtual bool Death(Mob* killerMob, int32 damage, uint16 spell_id, SkillUseTypes attack_skill); 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 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, virtual bool Attack(Mob* other, int Hand = 13, bool FromRiposte = false, bool IsStrikethrough = false, bool IsFromSpell = false, ExtraAttackOptions *opts = nullptr);
ExtraAttackOptions *opts = nullptr);
virtual bool HasRaid() { return (GetRaid() ? true : false); } virtual bool HasRaid() { return (GetRaid() ? true : false); }
virtual bool HasGroup() { return (GetGroup() ? true : false); } virtual bool HasGroup() { return (GetGroup() ? true : false); }
virtual Raid* GetRaid() { return entity_list.GetRaidByClient(this); } 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); 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); 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);
void FilteredMessage_StringID(Mob *sender, uint32 type, eqFilterType filter, 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);
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 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); void SendTraderItem(uint32 item_id,uint16 quantity);
uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity); uint16 FindTraderItem(int32 SerialNumber,uint16 Quantity);
@@ -780,8 +774,7 @@ public:
int16 acmod(); int16 acmod();
// Item methods // Item methods
uint32 NukeItem(uint32 itemnum, uint8 where_to_check = uint32 NukeItem(uint32 itemnum, uint8 where_to_check = (invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
(invWhereWorn | invWherePersonal | invWhereBank | invWhereSharedBank | invWhereTrading | invWhereCursor));
void SetTint(int16 slot_id, uint32 color); void SetTint(int16 slot_id, uint32 color);
void SetTint(int16 slot_id, Color_Struct& color); void SetTint(int16 slot_id, Color_Struct& color);
void SetMaterial(int16 slot_id, uint32 item_id); void SetMaterial(int16 slot_id, uint32 item_id);
@@ -1043,7 +1036,7 @@ public:
bool CalcItemScale(uint32 slot_x, uint32 slot_y); bool CalcItemScale(uint32 slot_x, uint32 slot_y);
void DoItemEnterZone(); void DoItemEnterZone();
bool DoItemEnterZone(uint32 slot_x, uint32 slot_y); 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 SummonAllCorpses(float dest_x, float dest_y, float dest_z, float dest_heading);
void DepopAllCorpses(); void DepopAllCorpses();
void DepopPlayerCorpse(uint32 dbid); void DepopPlayerCorpse(uint32 dbid);
@@ -1083,8 +1076,8 @@ public:
bool RemoveRespawnOption(std::string option_name); bool RemoveRespawnOption(std::string option_name);
bool RemoveRespawnOption(uint8 position); bool RemoveRespawnOption(uint8 position);
void ClearRespawnOptions() { respawn_options.clear(); } void ClearRespawnOptions() { respawn_options.clear(); }
void SetPendingRezzData(int XP, uint32 DBID, uint16 SpellID, const char *CorpseName) { PendingRezzXP = XP; PendingRezzDBID = DBID; PendingRezzSpellID = SpellID; PendingRezzCorpseName = CorpseName; } void SetPendingResurrectionData(int XP, uint32 DBID, uint16 SpellID, const char *CorpseName) { PendingResurrectionXP = XP; PendingResurrectionDBID = DBID; PendingResurrectionSpellID = SpellID; PendingResurrectionCorpseName = CorpseName; }
bool IsRezzPending() { return PendingRezzSpellID > 0; } bool IsResurrectionPending() { return PendingResurrectionSpellID > 0; }
void ClearHover(); void ClearHover();
inline bool IsBlockedBuff(int16 SpellID) { return PlayerBlockedBuffs.find(SpellID) != PlayerBlockedBuffs.end(); } inline bool IsBlockedBuff(int16 SpellID) { return PlayerBlockedBuffs.find(SpellID) != PlayerBlockedBuffs.end(); }
inline bool IsBlockedPetBuff(int16 SpellID) { return PetBlockedBuffs.find(SpellID) != PetBlockedBuffs.end(); } inline bool IsBlockedPetBuff(int16 SpellID) { return PetBlockedBuffs.find(SpellID) != PetBlockedBuffs.end(); }
@@ -1168,7 +1161,8 @@ public:
int16 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); } int16 GetActCHA() { return( std::min(GetMaxCHA(), GetCHA()) ); }
void LoadAccountFlags(); void LoadAccountFlags();
void SetAccountFlag(std::string flag, std::string val); 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 Consume(const Item_Struct *item, uint8 type, int16 slot, bool auto_consume);
void PlayMP3(const char* fname); void PlayMP3(const char* fname);
void ExpeditionSay(const char *str, int ExpID); void ExpeditionSay(const char *str, int ExpID);
@@ -1236,7 +1230,7 @@ private:
eqFilterMode ClientFilters[_FilterCount]; eqFilterMode ClientFilters[_FilterCount];
int32 HandlePacket(const EQApplicationPacket *app); int32 HandlePacket(const EQApplicationPacket *app);
void OPTGB(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 OPMemorizeSpell(const EQApplicationPacket *app);
void OPMoveCoin(const EQApplicationPacket* app); void OPMoveCoin(const EQApplicationPacket* app);
void MoveItemCharges(ItemInst &from, int16 to_slot, uint8 type); void MoveItemCharges(ItemInst &from, int16 to_slot, uint8 type);
@@ -1253,7 +1247,7 @@ private:
void HandleTraderPriceUpdate(const EQApplicationPacket *app); void HandleTraderPriceUpdate(const EQApplicationPacket *app);
int16 CalcAC(); int32 CalcAC();
int16 GetACMit(); int16 GetACMit();
int16 GetACAvoid(); int16 GetACAvoid();
int16 CalcATK(); int16 CalcATK();
@@ -1485,10 +1479,10 @@ private:
uint8 HideCorpseMode; uint8 HideCorpseMode;
bool PendingGuildInvitation; bool PendingGuildInvitation;
int PendingRezzXP; int PendingResurrectionXP;
uint32 PendingRezzDBID; uint32 PendingResurrectionDBID;
uint16 PendingRezzSpellID; // Only used for resurrect while hovering. uint16 PendingResurrectionSpellID; // Only used for resurrect while hovering.
std::string PendingRezzCorpseName; // Only used for resurrect while hovering. std::string PendingResurrectionCorpseName; // Only used for resurrect while hovering.
std::set<uint32> PlayerBlockedBuffs; std::set<uint32> PlayerBlockedBuffs;
std::set<uint32> PetBlockedBuffs; std::set<uint32> PetBlockedBuffs;
@@ -1507,4 +1501,3 @@ private:
}; };
#endif #endif
+299 -756
View File
File diff suppressed because it is too large Load Diff
+22 -50
View File
@@ -201,7 +201,7 @@ void MapOpcodes() {
ConnectedOpcodes[OP_CombatAbility] = &Client::Handle_OP_CombatAbility; ConnectedOpcodes[OP_CombatAbility] = &Client::Handle_OP_CombatAbility;
ConnectedOpcodes[OP_Taunt] = &Client::Handle_OP_Taunt; ConnectedOpcodes[OP_Taunt] = &Client::Handle_OP_Taunt;
ConnectedOpcodes[OP_InstillDoubt] = &Client::Handle_OP_InstillDoubt; 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_GMSummon] = &Client::Handle_OP_GMSummon;
ConnectedOpcodes[OP_TradeRequest] = &Client::Handle_OP_TradeRequest; ConnectedOpcodes[OP_TradeRequest] = &Client::Handle_OP_TradeRequest;
ConnectedOpcodes[OP_TradeRequestAck] = &Client::Handle_OP_TradeRequestAck; ConnectedOpcodes[OP_TradeRequestAck] = &Client::Handle_OP_TradeRequestAck;
@@ -2506,7 +2506,7 @@ void Client::Handle_OP_ConsiderCorpse(const EQApplicationPacket *app)
else else
Message(0, "This corpse will decay in %i minutes and %i seconds.", min, sec); 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; hour = 0;
@@ -4712,26 +4712,26 @@ void Client::Handle_OP_InstillDoubt(const EQApplicationPacket *app)
return; 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; const Resurrect_Struct* ra = (const Resurrect_Struct*) app->pBuffer;
_log(SPELLS__REZ, "Received OP_RezzAnswer from client. Pendingrezzexp is %i, action is %s", _log(SPELLS__RESURRECTION, "Received OP_ResurrectionAnswer from client. PendingResurrectionexp is %i, action is %s",
PendingRezzXP, ra->action ? "ACCEPT" : "DECLINE"); 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) if(ra->action == 1)
{ {
EQApplicationPacket* outapp = app->Copy(); EQApplicationPacket* outapp = app->Copy();
// Send the OP_RezzComplete to the world server. This finds it's way to the zone that // Send the OP_ResurrectionComplete to the world server. This finds it's way to the zone that
// the rezzed corpse is in to mark the corpse as rezzed. // the resurrected corpse is in to mark the corpse as resurrected.
outapp->SetOpcode(OP_RezzComplete); outapp->SetOpcode(OP_ResurrectionComplete);
worldserver.RezzPlayer(outapp, 0, 0, OP_RezzComplete); worldserver.ResurrectPlayer(outapp, 0, 0, OP_ResurrectionComplete);
safe_delete(outapp); safe_delete(outapp);
} }
return; return;
@@ -11598,22 +11598,14 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
database.DoEscapeString(EscSearchString, gmscs->Name, strlen(gmscs->Name)); database.DoEscapeString(EscSearchString, gmscs->Name, strlen(gmscs->Name));
if (database.RunQuery(Query, MakeAnyLenString(&Query, "select charname, zoneid, x, y, z, timeofdeath, rezzed, IsBurried from " 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)) {
"player_corpses where charname like '%%%s%%' order by charname limit %i",
EscSearchString, MaxResults), errbuf, &Result))
{
int NumberOfRows = mysql_num_rows(Result); int NumberOfRows = mysql_num_rows(Result);
if(NumberOfRows == MaxResults) if(NumberOfRows == MaxResults)
Message(clientMessageError, "Your search found too many results; some are not displayed."); Message(clientMessageError, "Your search found too many results; some are not displayed.");
else { else
Message(clientMessageYellow, "There are %i corpse(s) that match the search string '%s'.", Message(clientMessageYellow, "There are %i corpse(s) that match the search string '%s'.", NumberOfRows, gmscs->Name);
NumberOfRows, gmscs->Name);
}
if(NumberOfRows == 0) if(NumberOfRows == 0) {
{
mysql_free_result(Result); mysql_free_result(Result);
safe_delete_array(Query); safe_delete_array(Query);
return; return;
@@ -11621,51 +11613,31 @@ void Client::Handle_OP_GMSearchCorpse(const EQApplicationPacket *app)
char CharName[64], TimeOfDeath[20], Buffer[512]; 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>" 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>";
"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>";
while ((Row = mysql_fetch_row(Result))) while ((Row = mysql_fetch_row(Result))) {
{
strn0cpy(CharName, Row[0], sizeof(CharName)); strn0cpy(CharName, Row[0], sizeof(CharName));
uint32 ZoneID = atoi(Row[1]); uint32 ZoneID = atoi(Row[1]);
float CorpseX = atof(Row[2]); float CorpseX = atof(Row[2]);
float CorpseY = atof(Row[3]); float CorpseY = atof(Row[3]);
float CorpseZ = atof(Row[4]); float CorpseZ = atof(Row[4]);
strn0cpy(TimeOfDeath, Row[5], sizeof(TimeOfDeath)); strn0cpy(TimeOfDeath, Row[5], sizeof(TimeOfDeath));
bool CorpseResurrected = atoi(Row[6]);
bool CorpseRezzed = atoi(Row[6]);
bool CorpseBuried = atoi(Row[7]); 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, CorpseResurrected ? "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,
CorpseRezzed ? "Yes" : "No", CorpseBuried ? "Yes" : "No");
PopupText += Buffer; PopupText += Buffer;
if(PopupText.size() > 4000) {
if(PopupText.size() > 4000)
{
Message(clientMessageError, "Unable to display all the results."); Message(clientMessageError, "Unable to display all the results.");
break; break;
} }
} }
PopupText += "</table>"; PopupText += "</table>";
mysql_free_result(Result); mysql_free_result(Result);
SendPopupToClient("Corpses", PopupText.c_str()); SendPopupToClient("Corpses", PopupText.c_str());
} }
else{ else
Message(0, "Query failed: %s.", errbuf); Message(0, "Query failed: %s.", errbuf);
}
safe_delete_array(Query); safe_delete_array(Query);
safe_delete_array(EscSearchString); safe_delete_array(EscSearchString);
} }
+1 -1
View File
@@ -103,7 +103,7 @@
void Handle_OP_CombatAbility(const EQApplicationPacket *app); void Handle_OP_CombatAbility(const EQApplicationPacket *app);
void Handle_OP_Taunt(const EQApplicationPacket *app); void Handle_OP_Taunt(const EQApplicationPacket *app);
void Handle_OP_InstillDoubt(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_GMSummon(const EQApplicationPacket *app);
void Handle_OP_TradeRequest(const EQApplicationPacket *app); void Handle_OP_TradeRequest(const EQApplicationPacket *app);
void Handle_OP_TradeRequestAck(const EQApplicationPacket *app); void Handle_OP_TradeRequestAck(const EQApplicationPacket *app);
+33 -33
View File
@@ -1125,43 +1125,43 @@ uint8 Client::WithCustomer(uint16 NewCustomer){
return 0; 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) { if(PendingResurrectionXP < 0) {
// pendingrezexp is set to -1 if we are not expecting an OP_RezzAnswer // pendingmRessurectionExp is set to -1 if we are not expecting an OP_ResurrectionAnswer
_log(SPELLS__REZ, "Unexpected OP_RezzAnswer. Ignoring it."); _log(SPELLS__RESURRECTION, "Unexpected OP_ResurrectionAnswer. Ignoring it.");
Message(13, "You have already been resurrected.\n"); Message(13, "You have already been resurrected.\n");
return; return;
} }
if (Action == 1) if (Action == 1)
{ {
// Mark the corpse as rezzed in the database, just in case the corpse has buried, or the zone the // 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 rez spell was cast. // corpse is in has shutdown since the resurrection spell was cast.
database.MarkCorpseAsRezzed(PendingRezzDBID); database.MarkCorpseAsResurrected(PendingResurrectionDBID);
_log(SPELLS__REZ, "Player %s got a %i Rezz, spellid %i in zone%i, instance id %i", _log(SPELLS__RESURRECTION, "Player %s got a %i Resurrection, spellid %i in zone%i, instance id %i",
this->name, (uint16)spells[SpellID].base[0], this->name, (uint16)spells[SpellID].base[0],
SpellID, ZoneID, InstanceID); SpellID, ZoneID, InstanceID);
this->BuffFadeNonPersistDeath(); this->BuffFadeNonPersistDeath();
int SpellEffectDescNum = GetSpellEffectDescNum(SpellID); 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)) { if((SpellEffectDescNum == 82) || (SpellEffectDescNum == 39067)) {
SetMana(0); SetMana(0);
SetHP(GetMaxHP()/5); SetHP(GetMaxHP()/5);
SpellOnTarget(756, this); // Rezz effects SpellOnTarget(756, this); // Resurrection effects
} }
else { else {
SetMana(GetMaxMana()); SetMana(GetMaxMana());
SetHP(GetMaxHP()); 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); GetAAXP(),true);
} }
else if (spells[SpellID].base[0] == 100 && PendingRezzXP > 0) { else if (spells[SpellID].base[0] == 100 && PendingResurrectionXP > 0) {
SetEXP((GetEXP() + PendingRezzXP), GetAAXP(), true); SetEXP((GetEXP() + PendingResurrectionXP), GetAAXP(), true);
} }
//Was sending the packet back to initiate client zone... //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); MovePC(ZoneID, InstanceID, x, y, z, GetHeading(), 0, ZoneSolicited);
entity_list.RefreshClientXTargets(this); entity_list.RefreshClientXTargets(this);
} }
PendingRezzXP = -1; PendingResurrectionXP = -1;
PendingRezzSpellID = 0; PendingResurrectionSpellID = 0;
} }
void Client::OPTGB(const EQApplicationPacket *app) void Client::OPTGB(const EQApplicationPacket *app)
@@ -2043,7 +2043,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
RespawnFromHoverTimer.Disable(); RespawnFromHoverTimer.Disable();
RespawnOption* chosen = nullptr; RespawnOption* chosen = nullptr;
bool is_rez = false; bool is_resurrected = false;
//Find the selected option //Find the selected option
if (Option == 0) if (Option == 0)
@@ -2053,7 +2053,7 @@ void Client::HandleRespawnFromHover(uint32 Option)
else if (Option == (respawn_options.size() - 1)) else if (Option == (respawn_options.size() - 1))
{ {
chosen = &respawn_options.back(); 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 else
{ {
@@ -2083,21 +2083,21 @@ void Client::HandleRespawnFromHover(uint32 Option)
default_to_bind->z = b->z; default_to_bind->z = b->z;
default_to_bind->heading = b->heading; default_to_bind->heading = b->heading;
chosen = default_to_bind; chosen = default_to_bind;
is_rez = false; is_resurrected = false;
} }
if (chosen->zoneid == zone->GetZoneID()) //If they should respawn in the current zone... 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; return;
} }
SetHP(GetMaxHP() / 5); SetHP(GetMaxHP() / 5);
Corpse* corpse = entity_list.GetCorpseByName(PendingRezzCorpseName.c_str()); Corpse* corpse = entity_list.GetCorpseByName(PendingResurrectionCorpseName.c_str());
if (corpse) if (corpse)
{ {
@@ -2121,22 +2121,22 @@ void Client::HandleRespawnFromHover(uint32 Option)
ClearHover(); ClearHover();
SendHPUpdate(); 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()) if (corpse && corpse->IsCorpse())
{ {
_log(SPELLS__REZ, "Hover Rez in zone %s for corpse %s", _log(SPELLS__RESURRECTION, "Hover Resurrection in zone %s for corpse %s",
zone->GetShortName(), PendingRezzCorpseName.c_str()); 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->setResurrected(true);
corpse->CompleteRezz(); 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); EQApplicationPacket* outapp = new EQApplicationPacket(OP_ZonePlayerToBind, sizeof(ZonePlayerToBind_Struct) + chosen->name.length() + 1);
ZonePlayerToBind_Struct* gmg = (ZonePlayerToBind_Struct*) outapp->pBuffer; 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 //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 //easiest way to make sure it stays at the end and
//doesn't disrupt adding/removing scripted options //doesn't disrupt adding/removing scripted options
respawn_options.pop_back(); respawn_options.pop_back();
+23 -23
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("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("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("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("getplayerburiedcorpsecount","- Get the target's total number of buried player corpses.", 100, command_getplayerburiedcorpsecount) ||
command_add("summonburriedplayercorpse","- Summons the target's oldest burried corpse, if any exist.", 100, command_summonburriedplayercorpse) || 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("refreshgroup","- Refreshes Group.", 0, command_refreshgroup) ||
command_add("advnpcspawn","[maketype|makegroup|addgroupentry|addgroupspawn][removegroupspawn|movespawn|editgroupbox|cleargroupbox]",150,command_advnpcspawn) || 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) || 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){ void command_sendop(Client *c,const Seperator *sep){
int RezSpell = 0; int ResurrectionSpell = 0;
if(sep->arg[1][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; Resurrect_Struct *rs = (Resurrect_Struct*)outapp->pBuffer;
strcpy(rs->your_name, c->GetName()); strcpy(rs->your_name, c->GetName());
strcpy(rs->rezzer_name, "A Cleric01"); strcpy(rs->resurrecter_name, "A Cleric01");
rs->spellid = RezSpell; rs->spellid = ResurrectionSpell;
DumpPacket(outapp); DumpPacket(outapp);
c->QueuePacket(outapp); c->QueuePacket(outapp);
safe_delete(outapp); safe_delete(outapp);
@@ -1062,7 +1062,7 @@ void command_npcloot(Client *c, const Seperator *sep)
if (c->GetTarget()->IsNPC()) if (c->GetTarget()->IsNPC())
c->GetTarget()->CastToNPC()->QueryLoot(c); c->GetTarget()->CastToNPC()->QueryLoot(c);
else if (c->GetTarget()->IsCorpse()) else if (c->GetTarget()->IsCorpse())
c->GetTarget()->CastToCorpse()->QueryLoot(c); c->GetTarget()->CastToCorpse()->queryLoot(c);
else else
c->Message(0, "Error: Target's type doesnt have loot"); 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)) else if (!sep->IsNumber(2))
c->Message(0, "Error: charid must be a number."); c->Message(0, "Error: charid must be a number.");
else 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) { else if (strcasecmp(sep->arg[1], "ResetLooter") == 0) {
if (target == 0 || !target->IsCorpse()) if (target == 0 || !target->IsCorpse())
@@ -3677,12 +3677,12 @@ void command_corpse(Client *c, const Seperator *sep)
else else
target->CastToCorpse()->ResetLooter(); target->CastToCorpse()->ResetLooter();
} }
else if (strcasecmp(sep->arg[1], "RemoveCash") == 0) { else if (strcasecmp(sep->arg[1], "removeCash") == 0) {
if (target == 0 || !target->IsCorpse()) if (target == 0 || !target->IsCorpse())
c->Message(0, "Error: Target the corpse you wish to remove the cash from"); c->Message(0, "Error: Target the corpse you wish to remove the cash from");
else if (!target->IsPlayerCorpse() || c->Admin() >= commandEditPlayerCorpses) { else if (!target->IsPlayerCorpse() || c->Admin() >= commandEditPlayerCorpses) {
c->Message(0, "Removing Cash from %s.", target->GetName()); c->Message(0, "Removing Cash from %s.", target->GetName());
target->CastToCorpse()->RemoveCash(); target->CastToCorpse()->removeCash();
} }
else else
c->Message(0, "Insufficient status to modify player corpse."); 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()) if (target == 0 || !target->IsCorpse())
c->Message(0, "Error: Target must be a corpse."); c->Message(0, "Error: Target must be a corpse.");
else else
target->CastToCorpse()->QueryLoot(c); target->CastToCorpse()->queryLoot(c);
} }
else if (strcasecmp(sep->arg[1], "lock") == 0) { else if (strcasecmp(sep->arg[1], "lock") == 0) {
if (target == 0 || !target->IsCorpse()) if (target == 0 || !target->IsCorpse())
c->Message(0, "Error: Target must be a corpse."); c->Message(0, "Error: Target must be a corpse.");
else { else {
target->CastToCorpse()->Lock(); target->CastToCorpse()->lock();
c->Message(0, "Locking %s...", target->GetName()); c->Message(0, "Locking %s...", target->GetName());
} }
} }
@@ -3705,7 +3705,7 @@ void command_corpse(Client *c, const Seperator *sep)
if (target == 0 || !target->IsCorpse()) if (target == 0 || !target->IsCorpse())
c->Message(0, "Error: Target must be a corpse."); c->Message(0, "Error: Target must be a corpse.");
else { else {
target->CastToCorpse()->UnLock(); target->CastToCorpse()->unlock();
c->Message(0, "Unlocking %s...", target->GetName()); 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, " ListNPC");
c->Message(0, " ListPlayer"); c->Message(0, " ListPlayer");
c->Message(0, " Lock - GM locks the corpse - cannot be looted by non-GM"); c->Message(0, " Lock - GM locks the corpse - cannot be looted by non-GM");
c->Message(0, " UnLock"); c->Message(0, " Unlock");
c->Message(0, " RemoveCash"); c->Message(0, " removeCash");
c->Message(0, " InspectLoot"); c->Message(0, " InspectLoot");
c->Message(0, " [to remove items from corpses, loot them]"); c->Message(0, " [to remove items from corpses, loot them]");
c->Message(0, "Lead-GM status required to delete/modify player corpses"); 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; return;
} }
void command_summonburriedplayercorpse(Client *c, const Seperator *sep) void command_summonburiedplayercorpse(Client *c, const Seperator *sep)
{ {
Client *t=c; Client *t=c;
@@ -8794,15 +8794,15 @@ void command_summonburriedplayercorpse(Client *c, const Seperator *sep)
return; 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) 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; return;
} }
void command_getplayerburriedcorpsecount(Client *c, const Seperator *sep) void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep)
{ {
Client *t=c; Client *t=c;
@@ -8813,12 +8813,12 @@ void command_getplayerburriedcorpsecount(Client *c, const Seperator *sep)
return; return;
} }
uint32 CorpseCount = database.GetPlayerBurriedCorpseCount(t->CharacterID()); uint32 CorpseCount = database.GetPlayerBuriedCorpseCount(t->CharacterID());
if(CorpseCount > 0) 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 else
c->Message(0, "Your target doesn't have any burried corpses."); c->Message(0, "Your target doesn't have any buried corpses.");
return; return;
} }
+2 -2
View File
@@ -286,8 +286,8 @@ void command_refundaa(Client *c, const Seperator *sep);
void command_traindisc(Client *c, const Seperator *sep); void command_traindisc(Client *c, const Seperator *sep);
void command_deletegraveyard(Client *c, const Seperator *sep); void command_deletegraveyard(Client *c, const Seperator *sep);
void command_setgraveyard(Client *c, const Seperator *sep); void command_setgraveyard(Client *c, const Seperator *sep);
void command_getplayerburriedcorpsecount(Client *c, const Seperator *sep); void command_getplayerburiedcorpsecount(Client *c, const Seperator *sep);
void command_summonburriedplayercorpse(Client *c, const Seperator *sep); void command_summonburiedplayercorpse(Client *c, const Seperator *sep);
void command_unscribespell(Client *c, const Seperator *sep); void command_unscribespell(Client *c, const Seperator *sep);
void command_scribespell(Client *c, const Seperator *sep); void command_scribespell(Client *c, const Seperator *sep);
void command_refreshgroup(Client *c, const Seperator *sep); void command_refreshgroup(Client *c, const Seperator *sep);
+2 -2
View File
@@ -11,8 +11,8 @@
#define _CLIENT(x) (x && x->IsClient() && !x->CastToClient()->IsBecomeNPC()) #define _CLIENT(x) (x && x->IsClient() && !x->CastToClient()->IsBecomeNPC())
#define _NPC(x) (x && x->IsNPC() && !x->CastToMob()->GetOwnerID()) #define _NPC(x) (x && x->IsNPC() && !x->CastToMob()->GetOwnerID())
#define _BECOMENPC(x) (x && x->IsClient() && x->CastToClient()->IsBecomeNPC()) #define _BECOMENPC(x) (x && x->IsClient() && x->CastToClient()->IsBecomeNPC())
#define _CLIENTCORPSE(x) (x && x->IsCorpse() && x->CastToCorpse()->IsPlayerCorpse() && !x->CastToCorpse()->IsBecomeNPCCorpse()) #define _CLIENTCORPSE(x) (x && x->IsCorpse() && x->CastToCorpse()->IsPlayerCorpse())
#define _NPCCORPSE(x) (x && x->IsCorpse() && (x->CastToCorpse()->IsNPCCorpse() || x->CastToCorpse()->IsBecomeNPCCorpse())) #define _NPCCORPSE(x) (x && x->IsCorpse() && (x->CastToCorpse()->IsNPCCorpse()))
#define _CLIENTPET(x) (x && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsClient()) #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 _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()) #define _BECOMENPCPET(x) (x && x->CastToMob()->GetOwner() && x->CastToMob()->GetOwner()->IsClient() && x->CastToMob()->GetOwner()->CastToClient()->IsBecomeNPC())
+293 -304
View File
File diff suppressed because it is too large Load Diff
+101 -55
View File
@@ -51,22 +51,18 @@ public:
void LoadPlayerCorpseDecayTime(uint32 dbid); void LoadPlayerCorpseDecayTime(uint32 dbid);
bool IsCorpse() const { return true; } bool IsCorpse() const { return true; }
bool IsPlayerCorpse() const { return p_PlayerCorpse; } bool IsPlayerCorpse() const { return mPlayerCorpse; }
bool IsNPCCorpse() const { return !p_PlayerCorpse; } bool IsNPCCorpse() const { return !mPlayerCorpse; }
bool IsBecomeNPCCorpse() const { return become_npc; }
bool Process(); bool Process();
bool Save(); bool Save();
uint32 GetCharID() { return charid; }
uint32 SetCharID(uint32 iCharID) { if (IsPlayerCorpse()) { return (charid=iCharID); } return 0xFFFFFFFF; }; uint32 GetDecayTime() { if (!mDecayTimer.Enabled()) return 0xFFFFFFFF; else return mDecayTimer.GetRemainingTime(); }
uint32 GetDecayTime() { if (!corpse_decay_timer.Enabled()) return 0xFFFFFFFF; else return corpse_decay_timer.GetRemainingTime(); } uint32 GetResTime() { if (!mResurrectionTimer.Enabled()) return 0; else return mResurrectionTimer.GetRemainingTime(); }
uint32 GetResTime() { if (!corpse_res_timer.Enabled()) return 0; else return corpse_res_timer.GetRemainingTime(); }
void CalcCorpseName(); void CalcCorpseName();
inline void Lock() { pLocked = true; }
inline void UnLock() { pLocked = false; } inline void ResetLooter() { mBeingLootedBy = 0xFFFFFFFF; }
inline bool IsLocked() { return pLocked; } inline bool IsBeingLooted() { return (mBeingLootedBy != 0xFFFFFFFF); }
inline void ResetLooter() { BeingLootedBy = 0xFFFFFFFF; } inline uint32 GetDBID() { return mDBID; }
inline bool IsBeingLooted() { return (BeingLootedBy != 0xFFFFFFFF); }
inline uint32 GetDBID() { return dbid; }
inline char* GetOwnerName() { return orgname;} inline char* GetOwnerName() { return orgname;}
void SetDecayTimer(uint32 decaytime); void SetDecayTimer(uint32 decaytime);
@@ -76,68 +72,118 @@ public:
ServerLootItem_Struct* GetItem(uint16 lootslot, ServerLootItem_Struct** bag_item_data = 0); ServerLootItem_Struct* GetItem(uint16 lootslot, ServerLootItem_Struct** bag_item_data = 0);
void RemoveItem(uint16 lootslot); void RemoveItem(uint16 lootslot);
void RemoveItem(ServerLootItem_Struct* item_data); 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 Delete();
void Bury(); void Bury();
virtual void Depop(); virtual void Depop();
virtual void DepopCorpse(); 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 FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho);
void MakeLootRequestPackets(Client* client, const EQApplicationPacket* app); void MakeLootRequestPackets(Client* client, const EQApplicationPacket* app);
void LootItem(Client* client, const EQApplicationPacket* app); void LootItem(Client* client, const EQApplicationPacket* app);
void EndLoot(Client* client, const EQApplicationPacket* app); void EndLoot(Client* client, const EQApplicationPacket* app);
bool Summon(Client* client, bool spell, bool CheckDistance); bool Summon(Client* client, bool spell, bool CheckDistance);
void CastRezz(uint16 spellid, Mob* Caster);
void CompleteRezz();
void SetPKItem(int32 id) { pkitem = id; } bool canMobLoot(int charid);
int32 GetPKItem() { return pkitem; }
bool CanMobLoot(int charid); void AllowMobLoot(Mob* pCharacer, uint8 pSlot);
void AllowMobLoot(Mob *them, uint8 slot); void addLooter(Mob* pCharacer);
void AddLooter(Mob *who);
bool Rezzed() { return rez; }
void Rezzed(bool in_rez) { rez = in_rez; }
void Spawn(); void Spawn();
char orgname[64]; char orgname[64];
uint32 GetEquipment(uint8 material_slot) const; // returns item id uint32 GetEquipment(uint8 material_slot) const; // returns item id
uint32 GetEquipmentColor(uint8 material_slot) const; 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: protected:
std::list<uint32> MoveItemToCorpse(Client *client, ItemInst *item, int16 equipslot); std::list<uint32> MoveItemToCorpse(Client *client, ItemInst *item, int16 equipslot);
private: private:
bool p_PlayerCorpse; bool pIsChanged;
bool pLocked; bool mDespawnRequested; // Flag indicating that this corpse should despawn.
int32 pkitem; bool mChanged; // Flag indicating whether a player corpse has been changed since last save.
uint32 dbid; bool mResurrected; // Flag indicating whether the corpse has been resurrected.
uint32 charid; bool mLocked; // Flag indicating whether the corpse has been locked.
ItemList itemlist; bool mPlayerCorpse; // Flag indicating whether the corpse belongs to a player.
uint32 copper;
uint32 silver; // Coin
uint32 gold; uint32 mCopper;
uint32 platinum; uint32 mSilver;
bool p_depop; uint32 mGold;
uint32 BeingLootedBy; uint32 mPlatinum;
uint32 rezzexp;
bool rez; int32 mPKItem; // Not completely sure what this does yet.
bool can_rez; uint32 mDBID; // ID field in 'player_corpses' table.
bool become_npc; uint32 mCharacterID; // Character ID who owns this corpse
int looters[MAX_LOOTERS]; // People allowed to loot the corpse, character id uint32 mBeingLootedBy; // Client ID of whoever is looting this corpse.
Timer corpse_decay_timer; uint32 mResurrectionExp; // Amount of EXP the player lost creating this corpse.
Timer corpse_res_timer;
Timer corpse_delay_timer; Timer mDecayTimer; // Timer controlling how long before this corpse decays.
Timer corpse_graveyard_timer; Timer mResurrectionTimer; // Timer controlling how long this corpse can be resurrected.
Timer loot_cooldown_timer; Timer mCoolDownTimer; // Timer prevents anyone from looting a corpse within 10ms (No idea why).
Color_Struct item_tint[9]; 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 #endif
+10 -10
View File
@@ -1738,12 +1738,12 @@ XS(XS__clear_zone_flag)
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS__summonburriedplayercorpse); XS(XS__summonburiedplayercorpse);
XS(XS__summonburriedplayercorpse) XS(XS__summonburiedplayercorpse)
{ {
dXSARGS; dXSARGS;
if (items != 5) 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; bool RETVAL;
uint32 char_id = (int)SvIV(ST(0)); uint32 char_id = (int)SvIV(ST(0));
@@ -1752,7 +1752,7 @@ XS(XS__summonburriedplayercorpse)
float dest_z = (float)SvIV(ST(3)); float dest_z = (float)SvIV(ST(3));
float dest_heading = (float)SvIV(ST(4)); 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); ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0)); sv_2mortal(ST(0));
@@ -1780,19 +1780,19 @@ XS(XS__summonallplayercorpses)
XSRETURN(1); XSRETURN(1);
} }
XS(XS__getplayerburriedcorpsecount); XS(XS__getplayerburiedcorpsecount);
XS(XS__getplayerburriedcorpsecount) XS(XS__getplayerburiedcorpsecount)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: getplayerburriedcorpsecount(char_id)"); Perl_croak(aTHX_ "Usage: getplayerburiedcorpsecount(char_id)");
uint32 RETVAL; uint32 RETVAL;
dXSTARG; dXSTARG;
uint32 char_id = (int)SvIV(ST(0)); uint32 char_id = (int)SvIV(ST(0));
RETVAL = quest_manager.getplayerburriedcorpsecount(char_id); RETVAL = quest_manager.getplayerburiedcorpsecount(char_id);
XSprePUSH; PUSHu((IV)RETVAL); XSprePUSH; PUSHu((IV)RETVAL);
XSRETURN(1); 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, "has_zone_flag"), XS__has_zone_flag, file);
newXS(strcpy(buf, "set_zone_flag"), XS__set_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, "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, "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, "buryplayercorpse"), XS__buryplayercorpse, file);
newXS(strcpy(buf, "forcedooropen"), XS__forcedooropen, file); newXS(strcpy(buf, "forcedooropen"), XS__forcedooropen, file);
newXS(strcpy(buf, "forcedoorclose"), XS__forcedoorclose, file); newXS(strcpy(buf, "forcedoorclose"), XS__forcedoorclose, file);
+9 -9
View File
@@ -1599,7 +1599,7 @@ void EntityList::RemoveAllCorpsesByCharID(uint32 charid)
{ {
auto it = corpse_list.begin(); auto it = corpse_list.begin();
while (it != corpse_list.end()) { while (it != corpse_list.end()) {
if (it->second->GetCharID() == charid) { if (it->second->getCharacterID() == charid) {
safe_delete(it->second); safe_delete(it->second);
free_ids.push(it->first); free_ids.push(it->first);
it = corpse_list.erase(it); 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(); auto it = corpse_list.begin();
while (it != corpse_list.end()) { while (it != corpse_list.end()) {
if (it->second->GetCharID() == charid) { if (it->second->getCharacterID() == charid) {
RezzExp += it->second->GetRezzExp(); ResurrectionExp += it->second->getResurrectionExp();
it->second->Rezzed(true); it->second->setResurrected(true);
it->second->CompleteRezz(); it->second->CompleteResurrection();
} }
++it; ++it;
} }
return RezzExp; return ResurrectionExp;
} }
Group *EntityList::GetGroupByMob(Mob *mob) Group *EntityList::GetGroupByMob(Mob *mob)
@@ -4353,7 +4353,7 @@ void EntityList::HideCorpses(Client *c, uint8 CurrentMode, uint8 NewMode)
while (it != corpse_list.end()) { while (it != corpse_list.end()) {
Corpse *b = it->second; Corpse *b = it->second;
if (b && (b->GetCharID() != c->CharacterID())) { if (b && (b->getCharacterID() != c->CharacterID())) {
if ((NewMode == HideCorpseAll) || ((NewMode == HideCorpseNPC) && (b->IsNPCCorpse()))) { if ((NewMode == HideCorpseAll) || ((NewMode == HideCorpseNPC) && (b->IsNPCCorpse()))) {
EQApplicationPacket outapp; EQApplicationPacket outapp;
b->CreateDespawnPacket(&outapp, false); b->CreateDespawnPacket(&outapp, false);
+1 -1
View File
@@ -169,7 +169,7 @@ public:
Doors *GetDoorsByDBID(uint32 id); Doors *GetDoorsByDBID(uint32 id);
void RemoveAllCorpsesByCharID(uint32 charid); void RemoveAllCorpsesByCharID(uint32 charid);
void RemoveCorpseByDBID(uint32 dbid); void RemoveCorpseByDBID(uint32 dbid);
int RezzAllCorpsesByCharID(uint32 charid); int ResurrectAllCorpsesByCharID(uint32 charid);
bool IsMobInZone(Mob *who); bool IsMobInZone(Mob *who);
void ClearClientPetitionQueue(); void ClearClientPetitionQueue();
bool CanAddHateForMob(Mob *p); bool CanAddHateForMob(Mob *p);
+4 -4
View File
@@ -194,8 +194,8 @@ void Client::AddEXP(uint32 in_add_exp, uint8 conlevel, bool resexp) {
SetEXP(exp, aaexp, resexp); SetEXP(exp, aaexp, resexp);
} }
void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool isrezzexp) { void Client::SetEXP(uint32 set_exp, uint32 set_aaxp, bool ismRessurectionExp) {
_log(CLIENT__EXP, "Attempting to Set Exp for %s (XP: %u, AAXP: %u, Rez: %s)", this->GetCleanName(), set_exp, set_aaxp, isrezzexp ? "true" : "false"); _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 = 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() max_AAXP = RuleI(AA, ExpPerPoint); //this may be redundant since we're doing this in Client::FinishConnState2()
if (max_AAXP == 0 || GetEXPForLevel(GetLevel()) == 0xFFFFFFFF) { 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 ((set_exp + set_aaxp) > (m_pp.exp+m_pp.expAA)) {
if (isrezzexp) if (ismRessurectionExp)
this->Message_StringID(MT_Experience, REZ_REGAIN); this->Message_StringID(MT_Experience, RESURRECTION_REGAIN);
else{ else{
if(this->IsGrouped()) if(this->IsGrouped())
this->Message_StringID(MT_Experience, GAIN_GROUPXP); this->Message_StringID(MT_Experience, GAIN_GROUPXP);
+15 -15
View File
@@ -9,7 +9,7 @@
uint32 Lua_Corpse::GetCharID() { uint32 Lua_Corpse::GetCharID() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetCharID(); return self->getCharacterID();
} }
uint32 Lua_Corpse::GetDecayTime() { uint32 Lua_Corpse::GetDecayTime() {
@@ -19,17 +19,17 @@ uint32 Lua_Corpse::GetDecayTime() {
void Lua_Corpse::Lock() { void Lua_Corpse::Lock() {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->Lock(); self->lock();
} }
void Lua_Corpse::UnLock() { void Lua_Corpse::UnLock() {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->UnLock(); self->unlock();
} }
bool Lua_Corpse::IsLocked() { bool Lua_Corpse::IsLocked() {
Lua_Safe_Call_Bool(); Lua_Safe_Call_Bool();
return self->IsLocked(); return self->isLocked();
} }
void Lua_Corpse::ResetLooter() { void Lua_Corpse::ResetLooter() {
@@ -44,7 +44,7 @@ uint32 Lua_Corpse::GetDBID() {
bool Lua_Corpse::IsRezzed() { bool Lua_Corpse::IsRezzed() {
Lua_Safe_Call_Bool(); Lua_Safe_Call_Bool();
return self->Rezzed(); return self->isResurrected();
} }
const char* Lua_Corpse::GetOwnerName() { const char* Lua_Corpse::GetOwnerName() {
@@ -74,7 +74,7 @@ void Lua_Corpse::Depop() {
uint32 Lua_Corpse::CountItems() { uint32 Lua_Corpse::CountItems() {
Lua_Safe_Call_Int(); 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) { 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) { void Lua_Corpse::SetCash(uint32 copper, uint32 silver, uint32 gold, uint32 platinum) {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->SetCash(copper, silver, gold, platinum); self->setCash(copper, silver, gold, platinum);
} }
void Lua_Corpse::RemoveCash() { void Lua_Corpse::RemoveCash() {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->RemoveCash(); self->removeCash();
} }
bool Lua_Corpse::IsEmpty() { bool Lua_Corpse::IsEmpty() {
@@ -114,12 +114,12 @@ void Lua_Corpse::SetDecayTimer(uint32 decaytime) {
bool Lua_Corpse::CanMobLoot(int charid) { bool Lua_Corpse::CanMobLoot(int charid) {
Lua_Safe_Call_Bool(); Lua_Safe_Call_Bool();
return self->CanMobLoot(charid); return self->canMobLoot(charid);
} }
void Lua_Corpse::AllowMobLoot(Lua_Mob them, uint8 slot) { void Lua_Corpse::AllowMobLoot(Lua_Mob them, uint8 slot) {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->AllowMobLoot(them, slot); self->addLooter(them, slot);
} }
bool Lua_Corpse::Summon(Lua_Client client, bool spell, bool checkdistance) { 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() { uint32 Lua_Corpse::GetCopper() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetCopper(); return self->getCopper();
} }
uint32 Lua_Corpse::GetSilver() { uint32 Lua_Corpse::GetSilver() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetSilver(); return self->getSilver();
} }
uint32 Lua_Corpse::GetGold() { uint32 Lua_Corpse::GetGold() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetGold(); return self->getGold();
} }
uint32 Lua_Corpse::GetPlatinum() { uint32 Lua_Corpse::GetPlatinum() {
Lua_Safe_Call_Int(); Lua_Safe_Call_Int();
return self->GetPlatinum(); return self->getPlatinum();
} }
void Lua_Corpse::AddLooter(Lua_Mob who) { void Lua_Corpse::AddLooter(Lua_Mob who) {
Lua_Safe_Call_Void(); Lua_Safe_Call_Void();
self->AddLooter(who); self->addLooter(who);
} }
luabind::scope lua_register_corpse() { luabind::scope lua_register_corpse() {
+6 -6
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); 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) { void lua_summon_buried_player_corpse(uint32 char_id, float x, float y, float z, float h) {
quest_manager.summonburriedplayercorpse(char_id, x, y, z, 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) { 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); quest_manager.summonallplayercorpses(char_id, x, y, z, h);
} }
int lua_get_player_burried_corpse_count(uint32 char_id) { int lua_get_player_buried_corpse_count(uint32 char_id) {
return quest_manager.getplayerburriedcorpsecount(char_id); return quest_manager.getplayerburiedcorpsecount(char_id);
} }
bool lua_bury_player_corpse(uint32 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("spawn_condition", &lua_spawn_condition),
luabind::def("get_spawn_condition", &lua_get_spawn_condition), luabind::def("get_spawn_condition", &lua_get_spawn_condition),
luabind::def("toggle_spawn_event", &lua_toggle_spawn_event), 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("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("bury_player_corpse", &lua_bury_player_corpse),
luabind::def("task_selector", &lua_task_selector), luabind::def("task_selector", &lua_task_selector),
luabind::def("task_set_selector", &lua_task_set_selector), luabind::def("task_set_selector", &lua_task_set_selector),
+1 -1
View File
@@ -4385,7 +4385,7 @@ Corpse* Merc::GetGroupMemberCorpse() {
if(g->members[i] && g->members[i]->IsClient()) { if(g->members[i] && g->members[i]->IsClient()) {
corpse = entity_list.GetCorpseByOwnerWithinRange(g->members[i]->CastToClient(), this, RuleI(Mercs, ResurrectRadius)); corpse = entity_list.GetCorpseByOwnerWithinRange(g->members[i]->CastToClient(), this, RuleI(Mercs, ResurrectRadius));
if(corpse && !corpse->Rezzed()) { if(corpse && !corpse->isResurrected()) {
return corpse; return corpse;
} }
} }
+1 -1
View File
@@ -1243,7 +1243,7 @@ void Mob::ShowStats(Client* client)
} }
else if (IsCorpse()) { else if (IsCorpse()) {
if (IsPlayerCorpse()) { 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 { else {
client->Message(0, " NPCCorpse", GetID()); client->Message(0, " NPCCorpse", GetID());
+105 -81
View File
@@ -41,12 +41,12 @@
#endif #endif
XS(XS_Corpse_GetCharID); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_getCharacterID); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetCharID) XS(XS_Corpse_getCharacterID)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetCharID(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::getCharacterID(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
uint32 RETVAL; uint32 RETVAL;
@@ -61,7 +61,7 @@ XS(XS_Corpse_GetCharID)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCharID(); RETVAL = THIS->getCharacterID();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH; PUSHu((UV)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
@@ -93,12 +93,12 @@ XS(XS_Corpse_GetDecayTime)
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_Lock); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_lock); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_Lock) XS(XS_Corpse_lock)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::Lock(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::lock(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
@@ -111,17 +111,17 @@ XS(XS_Corpse_Lock)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->Lock(); THIS->lock();
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_UnLock); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_unlock); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_UnLock) XS(XS_Corpse_unlock)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::UnLock(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::unlock(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
@@ -134,17 +134,17 @@ XS(XS_Corpse_UnLock)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->UnLock(); THIS->unlock();
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_IsLocked); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_isLocked); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_IsLocked) XS(XS_Corpse_isLocked)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::IsLocked(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::isLocked(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
bool RETVAL; bool RETVAL;
@@ -158,7 +158,7 @@ XS(XS_Corpse_IsLocked)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->IsLocked(); RETVAL = THIS->isLocked();
ST(0) = boolSV(RETVAL); ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0)); sv_2mortal(ST(0));
} }
@@ -373,12 +373,12 @@ XS(XS_Corpse_RemoveItem)
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_SetCash); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_setCash); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_SetCash) XS(XS_Corpse_setCash)
{ {
dXSARGS; dXSARGS;
if (items != 5) 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; Corpse * THIS;
uint16 in_copper = (uint16)SvUV(ST(1)); uint16 in_copper = (uint16)SvUV(ST(1));
@@ -395,17 +395,17 @@ XS(XS_Corpse_SetCash)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); 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; XSRETURN_EMPTY;
} }
XS(XS_Corpse_RemoveCash); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_removeCash); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_RemoveCash) XS(XS_Corpse_removeCash)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::RemoveCash(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::removeCash(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
@@ -418,17 +418,17 @@ XS(XS_Corpse_RemoveCash)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->RemoveCash(); THIS->removeCash();
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_CountItems); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_getNumItems); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CountItems) XS(XS_Corpse_getNumItems)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::CountItems(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::getNumItems(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
uint32 RETVAL; uint32 RETVAL;
@@ -443,7 +443,7 @@ XS(XS_Corpse_CountItems)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->CountItems(); RETVAL = THIS->getNumItems();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH; PUSHu((UV)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
@@ -472,12 +472,12 @@ XS(XS_Corpse_Delete)
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_GetCopper); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_getCopper); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetCopper) XS(XS_Corpse_getCopper)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetCopper(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::getCopper(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
uint32 RETVAL; uint32 RETVAL;
@@ -492,18 +492,18 @@ XS(XS_Corpse_GetCopper)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetCopper(); RETVAL = THIS->getCopper();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH; PUSHu((UV)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetSilver); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_getSilver); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetSilver) XS(XS_Corpse_getSilver)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetSilver(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::getSilver(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
uint32 RETVAL; uint32 RETVAL;
@@ -518,18 +518,18 @@ XS(XS_Corpse_GetSilver)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetSilver(); RETVAL = THIS->getSilver();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH; PUSHu((UV)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetGold); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_getGold); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetGold) XS(XS_Corpse_getGold)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetGold(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::getGold(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
uint32 RETVAL; uint32 RETVAL;
@@ -544,18 +544,18 @@ XS(XS_Corpse_GetGold)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetGold(); RETVAL = THIS->getGold();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH; PUSHu((UV)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
} }
XS(XS_Corpse_GetPlatinum); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_getPlatinum); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_GetPlatinum) XS(XS_Corpse_getPlatinum)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::GetPlatinum(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::getPlatinum(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
uint32 RETVAL; uint32 RETVAL;
@@ -570,7 +570,7 @@ XS(XS_Corpse_GetPlatinum)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->GetPlatinum(); RETVAL = THIS->getPlatinum();
XSprePUSH; PUSHu((UV)RETVAL); XSprePUSH; PUSHu((UV)RETVAL);
} }
XSRETURN(1); XSRETURN(1);
@@ -610,12 +610,12 @@ XS(XS_Corpse_Summon)
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_CastRezz); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_CastResurrection); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CastRezz) XS(XS_Corpse_CastResurrection)
{ {
dXSARGS; dXSARGS;
if (items != 3) if (items != 3)
Perl_croak(aTHX_ "Usage: Corpse::CastRezz(THIS, spellid, Caster)"); Perl_croak(aTHX_ "Usage: Corpse::CastResurrection(THIS, spellid, Caster)");
{ {
Corpse * THIS; Corpse * THIS;
uint16 spellid = (uint16)SvUV(ST(1)); uint16 spellid = (uint16)SvUV(ST(1));
@@ -639,17 +639,17 @@ XS(XS_Corpse_CastRezz)
if(Caster == nullptr) if(Caster == nullptr)
Perl_croak(aTHX_ "Caster is nullptr, avoiding crash."); Perl_croak(aTHX_ "Caster is nullptr, avoiding crash.");
THIS->CastRezz(spellid, Caster); THIS->CastResurrection(spellid, Caster);
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_CompleteRezz); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_CompleteResurrection); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CompleteRezz) XS(XS_Corpse_CompleteResurrection)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::CompleteRezz(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::CompleteResurrection(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
@@ -662,17 +662,17 @@ XS(XS_Corpse_CompleteRezz)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
THIS->CompleteRezz(); THIS->CompleteResurrection();
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_CanMobLoot); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_canMobLoot); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_CanMobLoot) XS(XS_Corpse_canMobLoot)
{ {
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::CanMobLoot(THIS, charid)"); Perl_croak(aTHX_ "Usage: Corpse::canMobLoot(THIS, charid)");
{ {
Corpse * THIS; Corpse * THIS;
bool RETVAL; bool RETVAL;
@@ -687,7 +687,7 @@ XS(XS_Corpse_CanMobLoot)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->CanMobLoot(charid); RETVAL = THIS->canMobLoot(charid);
ST(0) = boolSV(RETVAL); ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0)); sv_2mortal(ST(0));
} }
@@ -728,12 +728,12 @@ XS(XS_Corpse_AllowMobLoot)
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_AddLooter); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_addLooter); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_AddLooter) XS(XS_Corpse_addLooter)
{ {
dXSARGS; dXSARGS;
if (items != 2) if (items != 2)
Perl_croak(aTHX_ "Usage: Corpse::AddLooter(THIS, who)"); Perl_croak(aTHX_ "Usage: Corpse::addLooter(THIS, who)");
{ {
Corpse * THIS; Corpse * THIS;
Mob * who; Mob * who;
@@ -756,17 +756,17 @@ XS(XS_Corpse_AddLooter)
if(who == nullptr) if(who == nullptr)
Perl_croak(aTHX_ "who is nullptr, avoiding crash."); Perl_croak(aTHX_ "who is nullptr, avoiding crash.");
THIS->AddLooter(who); THIS->addLooter(who);
} }
XSRETURN_EMPTY; XSRETURN_EMPTY;
} }
XS(XS_Corpse_IsRezzed); /* prototype to pass -Wmissing-prototypes */ XS(XS_Corpse_isResurrected); /* prototype to pass -Wmissing-prototypes */
XS(XS_Corpse_IsRezzed) XS(XS_Corpse_isResurrected)
{ {
dXSARGS; dXSARGS;
if (items != 1) if (items != 1)
Perl_croak(aTHX_ "Usage: Corpse::IsRezzed(THIS)"); Perl_croak(aTHX_ "Usage: Corpse::isResurrected(THIS)");
{ {
Corpse * THIS; Corpse * THIS;
bool RETVAL; bool RETVAL;
@@ -780,13 +780,37 @@ XS(XS_Corpse_IsRezzed)
if(THIS == nullptr) if(THIS == nullptr)
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash."); Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
RETVAL = THIS->Rezzed(); RETVAL = THIS->isResurrected();
ST(0) = boolSV(RETVAL); ST(0) = boolSV(RETVAL);
sv_2mortal(ST(0)); sv_2mortal(ST(0));
} }
XSRETURN(1); 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 #ifdef __cplusplus
extern "C" extern "C"
#endif #endif
@@ -806,11 +830,11 @@ XS(boot_Corpse)
XS_VERSION_BOOTCHECK ; 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, "GetDecayTime"), XS_Corpse_GetDecayTime, file, "$");
newXSproto(strcpy(buf, "Lock"), XS_Corpse_Lock, file, "$"); newXSproto(strcpy(buf, "lock"), XS_Corpse_lock, file, "$");
newXSproto(strcpy(buf, "UnLock"), XS_Corpse_UnLock, file, "$"); newXSproto(strcpy(buf, "unlock"), XS_Corpse_unlock, file, "$");
newXSproto(strcpy(buf, "IsLocked"), XS_Corpse_IsLocked, file, "$"); newXSproto(strcpy(buf, "isLocked"), XS_Corpse_isLocked, file, "$");
newXSproto(strcpy(buf, "ResetLooter"), XS_Corpse_ResetLooter, file, "$"); newXSproto(strcpy(buf, "ResetLooter"), XS_Corpse_ResetLooter, file, "$");
newXSproto(strcpy(buf, "GetDBID"), XS_Corpse_GetDBID, file, "$"); newXSproto(strcpy(buf, "GetDBID"), XS_Corpse_GetDBID, file, "$");
newXSproto(strcpy(buf, "GetOwnerName"), XS_Corpse_GetOwnerName, 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, "AddItem"), XS_Corpse_AddItem, file, "$$$;$");
newXSproto(strcpy(buf, "GetWornItem"), XS_Corpse_GetWornItem, file, "$$"); newXSproto(strcpy(buf, "GetWornItem"), XS_Corpse_GetWornItem, file, "$$");
newXSproto(strcpy(buf, "RemoveItem"), XS_Corpse_RemoveItem, file, "$$"); newXSproto(strcpy(buf, "RemoveItem"), XS_Corpse_RemoveItem, file, "$$");
newXSproto(strcpy(buf, "SetCash"), XS_Corpse_SetCash, file, "$$$$$"); newXSproto(strcpy(buf, "setCash"), XS_Corpse_setCash, file, "$$$$$");
newXSproto(strcpy(buf, "RemoveCash"), XS_Corpse_RemoveCash, file, "$"); newXSproto(strcpy(buf, "removeCash"), XS_Corpse_removeCash, file, "$");
newXSproto(strcpy(buf, "CountItems"), XS_Corpse_CountItems, file, "$"); newXSproto(strcpy(buf, "getNumItems"), XS_Corpse_getNumItems, file, "$");
newXSproto(strcpy(buf, "Delete"), XS_Corpse_Delete, file, "$"); newXSproto(strcpy(buf, "Delete"), XS_Corpse_Delete, file, "$");
newXSproto(strcpy(buf, "GetCopper"), XS_Corpse_GetCopper, file, "$"); newXSproto(strcpy(buf, "getCopper"), XS_Corpse_getCopper, file, "$");
newXSproto(strcpy(buf, "GetSilver"), XS_Corpse_GetSilver, file, "$"); newXSproto(strcpy(buf, "getSilver"), XS_Corpse_getSilver, file, "$");
newXSproto(strcpy(buf, "GetGold"), XS_Corpse_GetGold, file, "$"); newXSproto(strcpy(buf, "getGold"), XS_Corpse_getGold, file, "$");
newXSproto(strcpy(buf, "GetPlatinum"), XS_Corpse_GetPlatinum, file, "$"); newXSproto(strcpy(buf, "getPlatinum"), XS_Corpse_getPlatinum, file, "$");
newXSproto(strcpy(buf, "Summon"), XS_Corpse_Summon, file, "$$$"); newXSproto(strcpy(buf, "Summon"), XS_Corpse_Summon, file, "$$$");
newXSproto(strcpy(buf, "CastRezz"), XS_Corpse_CastRezz, file, "$$$"); newXSproto(strcpy(buf, "CastResurrection"), XS_Corpse_CastResurrection, file, "$$$");
newXSproto(strcpy(buf, "CompleteRezz"), XS_Corpse_CompleteRezz, file, "$"); newXSproto(strcpy(buf, "CompleteResurrection"), XS_Corpse_CompleteResurrection, file, "$");
newXSproto(strcpy(buf, "CanMobLoot"), XS_Corpse_CanMobLoot, 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, "AddLooter"), XS_Corpse_AddLooter, file, "$$"); newXSproto(strcpy(buf, "isResurrected"), XS_Corpse_isResurrected, file, "$");
newXSproto(strcpy(buf, "IsRezzed"), XS_Corpse_IsRezzed, file, "$"); newXSproto(strcpy(buf, "setResurrected"), XS_Corpse_setResurrected, file, "$$"); //Number of $ is dependent upon number of arguments needed.
XSRETURN_YES; XSRETURN_YES;
} }
+4 -4
View File
@@ -1753,11 +1753,11 @@ void QuestManager::sethp(int hpperc) {
owner->Damage(owner, newhp, SPELL_UNKNOWN, SkillHandtoHand, false, 0, false); 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; bool Result = false;
if(char_id > 0) { 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) { if(PlayerCorpse) {
Result = true; Result = true;
} }
@@ -1776,11 +1776,11 @@ bool QuestManager::summonallplayercorpses(uint32 char_id, float dest_x, float de
return Result; return Result;
} }
uint32 QuestManager::getplayerburriedcorpsecount(uint32 char_id) { uint32 QuestManager::getplayerburiedcorpsecount(uint32 char_id) {
uint32 Result = 0; uint32 Result = 0;
if(char_id > 0) { if(char_id > 0) {
Result = database.GetPlayerBurriedCorpseCount(char_id); Result = database.GetPlayerBuriedCorpseCount(char_id);
} }
return Result; return Result;
} }
+2 -2
View File
@@ -155,9 +155,9 @@ public:
void set_zone_flag(int zone_id); void set_zone_flag(int zone_id);
void clear_zone_flag(int zone_id); void clear_zone_flag(int zone_id);
void sethp(int hpperc); 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); 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); bool buryplayercorpse(uint32 char_id);
void forcedooropen(uint32 doorid, bool altmode); void forcedooropen(uint32 doorid, bool altmode);
void forcedoorclose(uint32 doorid, bool altmode); void forcedoorclose(uint32 doorid, bool altmode);
+3 -3
View File
@@ -1640,10 +1640,10 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) { if (IsCorpse() && CastToCorpse()->IsPlayerCorpse()) {
if(caster) 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()); spell_id, caster->GetName());
CastToCorpse()->CastRezz(spell_id, caster); CastToCorpse()->CastResurrection(spell_id, caster);
} }
break; break;
} }
@@ -2438,7 +2438,7 @@ bool Mob::SpellEffect(Mob* caster, uint16 spell_id, float partial)
case SE_SummonAndResAllCorpses: case SE_SummonAndResAllCorpses:
{ {
if(IsClient()) if(IsClient())
CastToClient()->SummonAndRezzAllCorpses(); CastToClient()->SummonAndResurrectAllCorpses();
break; break;
} }
+20 -20
View File
@@ -3654,42 +3654,42 @@ bool Mob::SpellOnTarget(uint16 spell_id, Mob* spelltar, bool reflect, bool use_r
return true; 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()) if(Caster && Caster->IsClient())
Caster->Message(13,"This character has already been resurrected."); Caster->Message(13,"This character has already been resurrected.");
return; return;
} }
/* /*
if(!can_rez) { if(!can_resurrect) {
if(Caster && Caster->IsClient()) if(Caster && Caster->IsClient())
Caster->Message_StringID(0, CORPSE_TOO_OLD); Caster->Message_StringID(0, CORPSE_TOO_OLD);
return; return;
} }
*/ */
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, sizeof(Resurrect_Struct)); EQApplicationPacket* outapp = new EQApplicationPacket(OP_ResurrectionRequest, sizeof(Resurrect_Struct));
Resurrect_Struct* rezz = (Resurrect_Struct*) outapp->pBuffer; Resurrect_Struct* resurrect = (Resurrect_Struct*) outapp->pBuffer;
// Why are we truncating these names to 30 characters ? // Why are we truncating these names to 30 characters ?
memcpy(rezz->your_name,this->orgname,30); memcpy(resurrect->your_name,this->orgname,30);
memcpy(rezz->corpse_name,this->name,30); memcpy(resurrect->corpse_name,this->name,30);
memcpy(rezz->rezzer_name,Caster->GetName(),30); memcpy(resurrect->resurrecter_name,Caster->GetName(),30);
rezz->zone_id = zone->GetZoneID(); resurrect->zone_id = zone->GetZoneID();
rezz->instance_id = zone->GetInstanceID(); resurrect->instance_id = zone->GetInstanceID();
rezz->spellid = spellid; resurrect->spellid = spellid;
rezz->x = this->x_pos; resurrect->x = this->x_pos;
rezz->y = this->y_pos; resurrect->y = this->y_pos;
rezz->z = this->z_pos; resurrect->z = this->z_pos;
rezz->unknown000 = 0x00000000; resurrect->unknown000 = 0x00000000;
rezz->unknown020 = 0x00000000; resurrect->unknown020 = 0x00000000;
rezz->unknown088 = 0x00000000; resurrect->unknown088 = 0x00000000;
// We send this to world, because it needs to go to the player who may not be in this zone. // 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); worldserver.ResurrectPlayer(outapp, mResurrectionExp, mDBID, OP_ResurrectionRequest);
_pkt(SPELLS__REZ, outapp); _pkt(SPELLS__RESURRECTION, outapp);
safe_delete(outapp); safe_delete(outapp);
} }
+38 -38
View File
@@ -655,64 +655,64 @@ void WorldServer::Process() {
else if (sus->status == 1) petition_list.ReadDatabase(); // Until I fix this to be better.... else if (sus->status == 1) petition_list.ReadDatabase(); // Until I fix this to be better....
break; break;
} }
case ServerOP_RezzPlayer: { case ServerOP_ResurrectPlayer: {
RezzPlayer_Struct* srs = (RezzPlayer_Struct*) pack->pBuffer; ResurrectPlayer_Struct* srs = (ResurrectPlayer_Struct*) pack->pBuffer;
if (srs->rezzopcode == OP_RezzRequest) 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. // 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)
{ {
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; char *Buffer = (char *)Response->pBuffer;
sprintf(Buffer, "%s", srs->rez.rezzer_name); sprintf(Buffer, "%s", srs->resurrect.resurrecter_name);
worldserver.SendPacket(Response); worldserver.SendPacket(Response);
safe_delete(Response); safe_delete(Response);
break; break;
} }
//pendingrezexp is the amount of XP on the corpse. Setting it to a value >= 0 //pendingmRessurectionExp is the amount of XP on the corpse. Setting it to a value >= 0
//also serves to inform Client::OPRezzAnswer to expect a packet. //also serves to inform Client::OPResurrectionAnswer to expect a packet.
client->SetPendingRezzData(srs->exp, srs->dbid, srs->rez.spellid, srs->rez.corpse_name); client->SetPendingResurrectionData(srs->exp, srs->dbid, srs->resurrect.spellid, srs->resurrect.corpse_name);
_log(SPELLS__REZ, "OP_RezzRequest in zone %s for %s, spellid:%i", _log(SPELLS__RESURRECTION, "OP_ResurrectionRequest in zone %s for %s, spellid:%i",
zone->GetShortName(), client->GetName(), srs->rez.spellid); zone->GetShortName(), client->GetName(), srs->resurrect.spellid);
EQApplicationPacket* outapp = new EQApplicationPacket(OP_RezzRequest, EQApplicationPacket* outapp = new EQApplicationPacket(OP_ResurrectionRequest,
sizeof(Resurrect_Struct)); sizeof(Resurrect_Struct));
memcpy(outapp->pBuffer, &srs->rez, sizeof(Resurrect_Struct)); memcpy(outapp->pBuffer, &srs->resurrect, sizeof(Resurrect_Struct));
client->QueuePacket(outapp); client->QueuePacket(outapp);
_pkt(SPELLS__REZ, outapp); _pkt(SPELLS__RESURRECTION, outapp);
safe_delete(outapp); safe_delete(outapp);
break; break;
} }
} }
if (srs->rezzopcode == OP_RezzComplete){ if (srs->resurrectionopcode == OP_ResurrectionComplete){
// We get here when the Rezz complete packet has come back via the world server // We get here when the Resurrection complete packet has come back via the world server
// to the zone that the corpse is in. // 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()) { if (corpse && corpse->IsCorpse()) {
_log(SPELLS__REZ, "OP_RezzComplete received in zone %s for corpse %s", _log(SPELLS__RESURRECTION, "OP_ResurrectionComplete received in zone %s for corpse %s",
zone->GetShortName(), srs->rez.corpse_name); zone->GetShortName(), srs->resurrect.corpse_name);
_log(SPELLS__REZ, "Found corpse. Marking corpse as rezzed."); _log(SPELLS__RESURRECTION, "Found corpse. Marking corpse as resurrected.");
// I don't know why Rezzed is not set to true in CompleteRezz(). // I don't know why Resurrected is not set to true in CompleteResurrection().
corpse->Rezzed(true); corpse->setResurrected(true);
corpse->CompleteRezz(); corpse->CompleteResurrection();
} }
} }
break; 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) if (c)
c->Message_StringID(MT_WornOff, REZZ_ALREADY_PENDING); c->Message_StringID(MT_WornOff, RESURRECTION_ALREADY_PENDING);
break; break;
} }
@@ -1944,20 +1944,20 @@ bool WorldServer::SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32
return Ret; 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); _log(SPELLS__RESURRECTION, "WorldServer::ResurrectionPlayer mRessurectionExp is %i (0 is normal for ResurrectionComplete", mRessurectionExp);
ServerPacket* pack = new ServerPacket(ServerOP_RezzPlayer, sizeof(RezzPlayer_Struct)); ServerPacket* pack = new ServerPacket(ServerOP_ResurrectPlayer, sizeof(ResurrectPlayer_Struct));
RezzPlayer_Struct* sem = (RezzPlayer_Struct*) pack->pBuffer; ResurrectPlayer_Struct* sem = (ResurrectPlayer_Struct*) pack->pBuffer;
sem->rezzopcode = opcode; sem->resurrectionopcode = opcode;
sem->rez = *(Resurrect_Struct*) rpack->pBuffer; sem->resurrect = *(Resurrect_Struct*) rpack->pBuffer;
sem->exp = rezzexp; sem->exp = mRessurectionExp;
sem->dbid = dbid; sem->dbid = dbid;
bool ret = SendPacket(pack); bool ret = SendPacket(pack);
if (ret) 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 else
_log(SPELLS__REZ, "NOT Sending player rezz packet to world"); _log(SPELLS__RESURRECTION, "NOT Sending player resurrection packet to world");
safe_delete(pack); safe_delete(pack);
return ret; return ret;
+1 -1
View File
@@ -41,7 +41,7 @@ public:
bool SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 MacroNumber, uint32 GroupOrRaidID = 0); bool SendVoiceMacro(Client* From, uint32 Type, char* Target, uint32 MacroNumber, uint32 GroupOrRaidID = 0);
void SetZone(uint32 iZoneID, uint32 iInstanceID = 0); void SetZone(uint32 iZoneID, uint32 iInstanceID = 0);
uint32 SendGroupIdRequest(); 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); } bool IsOOCMuted() const { return(oocmuted); }
uint32 NextGroupID(); uint32 NextGroupID();
+4 -4
View File
@@ -262,13 +262,13 @@ public:
bool GetDecayTimes(npcDecayTimes_Struct* npcCorpseDecayTimes); 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); 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); 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); 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 MarkCorpseAsRezzed(uint32 dbid); void MarkCorpseAsResurrected(uint32 dbid);
bool BuryPlayerCorpse(uint32 dbid); bool BuryPlayerCorpse(uint32 dbid);
bool BuryAllPlayerCorpses(uint32 charid); bool BuryAllPlayerCorpses(uint32 charid);
bool DeletePlayerCorpse(uint32 dbid); bool DeletePlayerCorpse(uint32 dbid);
uint32 GetPlayerBurriedCorpseCount(uint32 char_id); uint32 GetPlayerBuriedCorpseCount(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); 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 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); 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); Corpse* LoadPlayerCorpse(uint32 player_corpse_id);