mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-12 13:41:31 +00:00
Save PlayerState server side
We now send the PlayerState in the spawn struct to allow clients to see other bard animations with instrument to be played if they zone in after the bard equipped the instrument OP_WeaponEquip2 and OP_WeaponUnequip2 renamed to OP_PlayerStateAdd and OP_PlayerStateRemove Still needs work: Get AI controlled mobs sending the correct PlayerStates. (stunned, attacking, etc)
This commit is contained in:
parent
8224a9e776
commit
7bcfaf60ab
@ -364,6 +364,8 @@ N(OP_PetitionUnCheckout),
|
||||
N(OP_PetitionUpdate),
|
||||
N(OP_PickPocket),
|
||||
N(OP_PlayerProfile),
|
||||
N(OP_PlayerStateAdd),
|
||||
N(OP_PlayerStateRemove),
|
||||
N(OP_PlayEverquestRequest),
|
||||
N(OP_PlayEverquestResponse),
|
||||
N(OP_PlayMP3),
|
||||
@ -519,8 +521,6 @@ N(OP_VetRewardsAvaliable),
|
||||
N(OP_VoiceMacroIn),
|
||||
N(OP_VoiceMacroOut),
|
||||
N(OP_WeaponEquip1),
|
||||
N(OP_WeaponEquip2),
|
||||
N(OP_WeaponUnequip2),
|
||||
N(OP_WearChange),
|
||||
N(OP_Weather),
|
||||
N(OP_Weblink),
|
||||
|
||||
@ -273,7 +273,8 @@ struct Spawn_Struct {
|
||||
/*0146*/ uint8 beard; // Beard style (not totally, sure but maybe!)
|
||||
/*0147*/ uint8 unknown0147[4];
|
||||
/*0151*/ uint8 level; // Spawn Level
|
||||
/*0152*/ uint8 unknown0259[4]; // ***Placeholder
|
||||
// None = 0, Open = 1, WeaponSheathed = 2, Aggressive = 4, ForcedAggressive = 8, InstrumentEquipped = 16, Stunned = 32, PrimaryWeaponEquipped = 64, SecondaryWeaponEquipped = 128
|
||||
/*0152*/ uint32 PlayerState; // Controls animation stuff
|
||||
/*0156*/ uint8 beardcolor; // Beard color
|
||||
/*0157*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
|
||||
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
|
||||
@ -366,6 +367,11 @@ union
|
||||
|
||||
};
|
||||
|
||||
struct PlayerState_Struct {
|
||||
/*00*/ uint32 spawn_id;
|
||||
/*04*/ uint32 state;
|
||||
};
|
||||
|
||||
/*
|
||||
** New Spawn
|
||||
** Length: 176 Bytes
|
||||
|
||||
@ -3990,7 +3990,7 @@ namespace RoF
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petOwnerId);
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown13
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown14 - Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->PlayerState);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown15
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown16
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown17
|
||||
|
||||
@ -4140,7 +4140,7 @@ namespace RoF2
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petOwnerId);
|
||||
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown13
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown14 - Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->PlayerState);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown15
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown16
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown17
|
||||
|
||||
@ -416,7 +416,7 @@ struct Spawn_Struct
|
||||
/*0000*/ uint8 unknown12;
|
||||
/*0000*/ uint32 petOwnerId;
|
||||
/*0000*/ uint8 unknown13;
|
||||
/*0000*/ uint32 unknown14; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 PlayerState; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 unknown15;
|
||||
/*0000*/ uint32 unknown16;
|
||||
/*0000*/ uint32 unknown17;
|
||||
|
||||
@ -410,7 +410,7 @@ struct Spawn_Struct
|
||||
/*0000*/ uint8 unknown12;
|
||||
/*0000*/ uint32 petOwnerId;
|
||||
/*0000*/ uint8 unknown13;
|
||||
/*0000*/ uint32 unknown14; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 PlayerState; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 unknown15;
|
||||
/*0000*/ uint32 unknown16;
|
||||
/*0000*/ uint32 unknown17;
|
||||
|
||||
@ -2737,7 +2737,7 @@ namespace SoD
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown12
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petOwnerId);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown13
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown14 - Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->PlayerState);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown15
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown16
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown17
|
||||
|
||||
@ -286,7 +286,7 @@ struct Spawn_Struct
|
||||
/*0000*/ uint8 unknown12;
|
||||
/*0000*/ uint32 petOwnerId;
|
||||
/*0000*/ uint8 unknown13;
|
||||
/*0000*/ uint32 unknown14; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 PlayerState; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 unknown15;
|
||||
/*0000*/ uint32 unknown16;
|
||||
/*0000*/ uint32 unknown17;
|
||||
|
||||
@ -2088,6 +2088,7 @@ namespace SoF
|
||||
eq->runspeed = emu->runspeed;
|
||||
eq->light = emu->light;
|
||||
eq->level = emu->level;
|
||||
eq->PlayerState = emu->PlayerState;
|
||||
eq->lfg = emu->lfg;
|
||||
eq->hairstyle = emu->hairstyle;
|
||||
eq->haircolor = emu->haircolor;
|
||||
|
||||
@ -241,7 +241,8 @@ struct Spawn_Struct {
|
||||
/*0506*/ uint8 light; // Spawn's lightsource
|
||||
/*0507*/ uint8 unknown0507[4];
|
||||
/*0511*/ uint8 level; // Spawn Level
|
||||
/*0512*/ uint8 unknown0512[16];
|
||||
/*0512*/ uint32 PlayerState;
|
||||
/*0516*/ uint8 unknown0516[12];
|
||||
/*0528*/ uint8 lfg;
|
||||
/*0529*/ uint8 unknown0529[4];
|
||||
/*0533*/ uint8 hairstyle; // Sets the style of hair
|
||||
|
||||
@ -1549,7 +1549,7 @@ namespace Titanium
|
||||
eq->beardcolor = emu->beardcolor;
|
||||
// eq->unknown0147[4] = emu->unknown0147[4];
|
||||
eq->level = emu->level;
|
||||
// eq->unknown0259[4] = emu->unknown0259[4];
|
||||
eq->PlayerState = emu->PlayerState;
|
||||
eq->beard = emu->beard;
|
||||
strcpy(eq->suffix, emu->suffix);
|
||||
eq->petOwnerId = emu->petOwnerId;
|
||||
|
||||
@ -212,7 +212,7 @@ struct Spawn_Struct {
|
||||
/*0146*/ uint8 beardcolor; // Beard color
|
||||
/*0147*/ uint8 unknown0147[4];
|
||||
/*0151*/ uint8 level; // Spawn Level
|
||||
/*0152*/ uint8 unknown0259[4]; // ***Placeholder
|
||||
/*0152*/ uint32 PlayerState; // PlayerState controls some animation stuff
|
||||
/*0156*/ uint8 beard; // Beard style
|
||||
/*0157*/ char suffix[32]; // Player's suffix (of Veeshan, etc.)
|
||||
/*0189*/ uint32 petOwnerId; // If this is a pet, the spawn id of owner
|
||||
|
||||
@ -3005,7 +3005,7 @@ namespace UF
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown12
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->petOwnerId);
|
||||
VARSTRUCT_ENCODE_TYPE(uint8, Buffer, 0); // unknown13
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown14 - Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, emu->PlayerState);
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown15
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown16
|
||||
VARSTRUCT_ENCODE_TYPE(uint32, Buffer, 0); // unknown17
|
||||
|
||||
@ -286,7 +286,7 @@ struct Spawn_Struct
|
||||
/*0000*/ uint8 unknown12;
|
||||
/*0000*/ uint32 petOwnerId;
|
||||
/*0000*/ uint8 unknown13;
|
||||
/*0000*/ uint32 unknown14; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 PlayerState; // Stance 64 = normal 4 = aggressive 40 = stun/mezzed
|
||||
/*0000*/ uint32 unknown15;
|
||||
/*0000*/ uint32 unknown16;
|
||||
/*0000*/ uint32 unknown17;
|
||||
|
||||
@ -269,8 +269,8 @@ OP_RequestDuel=0x1ea9
|
||||
OP_MobRename=0x5040
|
||||
OP_AugmentItem=0x1627 # Was 0x37cb
|
||||
OP_WeaponEquip1=0x35c3
|
||||
OP_WeaponEquip2=0x012f # Was 0x6022
|
||||
OP_WeaponUnequip2=0x1076 # Was 0x0110
|
||||
OP_PlayerStateAdd=0x012f # Was 0x6022
|
||||
OP_PlayerStateRemove=0x1076 # Was 0x0110
|
||||
OP_ApplyPoison=0x1499
|
||||
OP_Save=0x2e6f
|
||||
OP_TestBuff=0x046e # Was 0x3772
|
||||
|
||||
@ -268,8 +268,8 @@ OP_RequestDuel=0x3af1
|
||||
OP_MobRename=0x2c57
|
||||
OP_AugmentItem=0x661b
|
||||
OP_WeaponEquip1=0x34a7
|
||||
OP_WeaponEquip2=0x559a
|
||||
OP_WeaponUnequip2=0x2d25
|
||||
OP_PlayerStateAdd=0x559a
|
||||
OP_PlayerStateRemove=0x2d25
|
||||
OP_ApplyPoison=0x31e6
|
||||
OP_Save=0x4a39
|
||||
OP_TestBuff=0x7cb8
|
||||
|
||||
@ -266,8 +266,8 @@ OP_RequestDuel=0x79e0 # C
|
||||
OP_MobRename=0x0a1d # C
|
||||
OP_AugmentItem=0x0370 # C
|
||||
OP_WeaponEquip1=0x719e # C
|
||||
OP_WeaponEquip2=0x7b6e # C
|
||||
OP_WeaponUnequip2=0x19a8 # C
|
||||
OP_PlayerStateAdd=0x7b6e # C
|
||||
OP_PlayerStateRemove=0x19a8 # C
|
||||
OP_ApplyPoison=0x405b # C
|
||||
OP_Save=0x5c85 # C
|
||||
OP_TestBuff=0x5fc7 # C
|
||||
|
||||
@ -262,8 +262,8 @@ OP_RequestDuel=0x3A2B #Xinu 02/22/09
|
||||
OP_MobRename=0x6be5 #Trevius 01/16/09
|
||||
OP_AugmentItem=0x172A #Trevius 03/14/09
|
||||
OP_WeaponEquip1=0x7260 #Trevius 02/27/09
|
||||
OP_WeaponEquip2=0x5C2F #Trevius 02/27/09
|
||||
OP_WeaponUnequip2=0x6213 #Trevius 02/27/09
|
||||
OP_PlayerStateAdd=0x5C2F #Trevius 02/27/09
|
||||
OP_PlayerStateRemove=0x6213 #Trevius 02/27/09
|
||||
OP_ApplyPoison=0x4543 #WildcardX 03/6/09
|
||||
OP_Save=0x72F2 #Trevius 03/15/09
|
||||
OP_TestBuff=0x07BF #/testbuff
|
||||
|
||||
@ -534,8 +534,8 @@ OP_PVPLeaderBoardDetailsRequest=0x06a2
|
||||
OP_PVPLeaderBoardDetailsReply=0x246a
|
||||
OP_PickLockSuccess=0x40E7
|
||||
OP_WeaponEquip1=0x6c5e
|
||||
OP_WeaponEquip2=0x63da
|
||||
OP_WeaponUnequip2=0x381d
|
||||
OP_PlayerStateAdd=0x63da
|
||||
OP_PlayerStateRemove=0x381d
|
||||
OP_VoiceMacroIn=0x2866 # Client to Server
|
||||
OP_VoiceMacroOut=0x2ec6 # Server to Client
|
||||
OP_CameraEffect=0x0937 # Correct
|
||||
|
||||
@ -272,8 +272,8 @@ OP_RequestDuel=0x6cfe # C
|
||||
OP_MobRename=0x0507 # C
|
||||
OP_AugmentItem=0x7c87 # C
|
||||
OP_WeaponEquip1=0x4572 # C
|
||||
OP_WeaponEquip2=0x399b # C
|
||||
OP_WeaponUnequip2=0x416b # C
|
||||
OP_PlayerStateAdd=0x399b # C
|
||||
OP_PlayerStateRemove=0x416b # C
|
||||
OP_ApplyPoison=0x5cd3 # C
|
||||
OP_Save=0x6618 # C
|
||||
OP_TestBuff=0x3415 # C
|
||||
|
||||
@ -2540,12 +2540,12 @@ void Client::LogMerchant(Client* player, Mob* merchant, uint32 quantity, uint32
|
||||
|
||||
bool Client::BindWound(Mob* bindmob, bool start, bool fail){
|
||||
EQApplicationPacket* outapp = 0;
|
||||
if(!fail)
|
||||
if(!fail)
|
||||
{
|
||||
outapp = new EQApplicationPacket(OP_Bind_Wound, sizeof(BindWound_Struct));
|
||||
BindWound_Struct* bind_out = (BindWound_Struct*) outapp->pBuffer;
|
||||
// Start bind
|
||||
if(!bindwound_timer.Enabled())
|
||||
if(!bindwound_timer.Enabled())
|
||||
{
|
||||
//make sure we actually have a bandage... and consume it.
|
||||
int16 bslot = m_inv.HasItemByUse(ItemTypeBandage, 1, invWhereWorn|invWherePersonal);
|
||||
@ -2592,9 +2592,9 @@ bool Client::BindWound(Mob* bindmob, bool start, bool fail){
|
||||
; // Binding self
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (bindwound_timer.Check()) // Did the timer finish?
|
||||
{
|
||||
{
|
||||
// finish bind
|
||||
// disable complete timer
|
||||
bindwound_timer.Disable();
|
||||
@ -5709,8 +5709,8 @@ void Client::ProcessInspectRequest(Client* requestee, Client* requester) {
|
||||
else if (inst && inst->GetOrnamentationIcon())
|
||||
{
|
||||
insr->itemicons[L] = inst->GetOrnamentationIcon();
|
||||
}
|
||||
else
|
||||
}
|
||||
else
|
||||
{
|
||||
insr->itemicons[L] = item->Icon;
|
||||
}
|
||||
@ -7612,7 +7612,7 @@ void Client::SetFactionLevel(uint32 char_id, uint32 npc_id, uint8 char_class, ui
|
||||
// Find out starting faction for this faction
|
||||
// It needs to be used to adj max and min personal
|
||||
// The range is still the same, 1200-3000(4200), but adjusted for base
|
||||
database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(),
|
||||
database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(),
|
||||
faction_id[i]);
|
||||
|
||||
// Adjust the amount you can go up or down so the resulting range
|
||||
@ -7653,7 +7653,7 @@ void Client::SetFactionLevel2(uint32 char_id, int32 faction_id, uint8 char_class
|
||||
// Find out starting faction for this faction
|
||||
// It needs to be used to adj max and min personal
|
||||
// The range is still the same, 1200-3000(4200), but adjusted for base
|
||||
database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(),
|
||||
database.GetFactionData(&fm, GetClass(), GetRace(), GetDeity(),
|
||||
faction_id);
|
||||
|
||||
// Adjust the amount you can go up or down so the resulting range
|
||||
@ -7839,14 +7839,14 @@ void Client::SendFactionMessage(int32 tmpvalue, int32 faction_id, int32 faction_
|
||||
char name[50];
|
||||
int32 faction_value;
|
||||
|
||||
// If we're dropping from MAX or raising from MIN or repairing,
|
||||
// If we're dropping from MAX or raising from MIN or repairing,
|
||||
// we should base the message on the new updated value so we don't show
|
||||
// a min MAX message
|
||||
//
|
||||
// If we're changing any other place, we use the value before the
|
||||
// hit. For example, if we go from 1199 to 1200 which is the MAX
|
||||
// we still want to say faction got better this time around.
|
||||
|
||||
|
||||
if ( (faction_before_hit >= this_faction_max) ||
|
||||
(faction_before_hit <= this_faction_min))
|
||||
faction_value = totalvalue;
|
||||
@ -8382,10 +8382,10 @@ std::string Client::TextLink::GenerateLink()
|
||||
m_Link.clear();
|
||||
m_LinkBody.clear();
|
||||
m_LinkText.clear();
|
||||
|
||||
|
||||
generate_body();
|
||||
generate_text();
|
||||
|
||||
|
||||
if ((m_LinkBody.length() == EmuConstants::TEXT_LINK_BODY_LENGTH) && (m_LinkText.length() > 0)) {
|
||||
m_Link.push_back(0x12);
|
||||
m_Link.append(m_LinkBody);
|
||||
@ -8424,7 +8424,7 @@ void Client::TextLink::generate_body()
|
||||
{
|
||||
/*
|
||||
Current server mask: EQClientRoF2
|
||||
|
||||
|
||||
RoF2: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%02X" "%05X" "%08X" (56)
|
||||
RoF: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X" (55)
|
||||
SoF: "%1X" "%05X" "%05X" "%05X" "%05X" "%05X" "%05X" "%1X" "%04X" "%1X" "%05X" "%08X" (50)
|
||||
@ -8432,7 +8432,7 @@ void Client::TextLink::generate_body()
|
||||
*/
|
||||
|
||||
memset(&m_LinkBodyStruct, 0, sizeof(TextLinkBody_Struct));
|
||||
|
||||
|
||||
const Item_Struct* item_data = nullptr;
|
||||
|
||||
switch (m_LinkType) {
|
||||
@ -8479,7 +8479,7 @@ void Client::TextLink::generate_body()
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (m_ProxyItemID != NOT_USED) {
|
||||
m_LinkBodyStruct.item_id = m_ProxyItemID;
|
||||
}
|
||||
|
||||
@ -305,6 +305,8 @@ void MapOpcodes()
|
||||
ConnectedOpcodes[OP_PetitionRefresh] = &Client::Handle_OP_PetitionRefresh;
|
||||
ConnectedOpcodes[OP_PetitionResolve] = &Client::Handle_OP_PetitionResolve;
|
||||
ConnectedOpcodes[OP_PetitionUnCheckout] = &Client::Handle_OP_PetitionUnCheckout;
|
||||
ConnectedOpcodes[OP_PlayerStateAdd] = &Client::Handle_OP_PlayerStateAdd;
|
||||
ConnectedOpcodes[OP_PlayerStateRemove] = &Client::Handle_OP_PlayerStateRemove;
|
||||
ConnectedOpcodes[OP_PickPocket] = &Client::Handle_OP_PickPocket;
|
||||
ConnectedOpcodes[OP_PopupResponse] = &Client::Handle_OP_PopupResponse;
|
||||
ConnectedOpcodes[OP_PotionBelt] = &Client::Handle_OP_PotionBelt;
|
||||
@ -381,8 +383,6 @@ void MapOpcodes()
|
||||
ConnectedOpcodes[OP_VetClaimRequest] = &Client::Handle_OP_VetClaimRequest;
|
||||
ConnectedOpcodes[OP_VoiceMacroIn] = &Client::Handle_OP_VoiceMacroIn;
|
||||
ConnectedOpcodes[OP_WearChange] = &Client::Handle_OP_WearChange;
|
||||
ConnectedOpcodes[OP_WeaponEquip2] = &Client::Handle_OP_WeaponEquip2;
|
||||
ConnectedOpcodes[OP_WeaponUnequip2] = &Client::Handle_OP_WeaponUnequip2;
|
||||
ConnectedOpcodes[OP_WhoAllRequest] = &Client::Handle_OP_WhoAllRequest;
|
||||
ConnectedOpcodes[OP_WorldUnknown001] = &Client::Handle_OP_Ignore;
|
||||
ConnectedOpcodes[OP_XTargetAutoAddHaters] = &Client::Handle_OP_XTargetAutoAddHaters;
|
||||
@ -10325,6 +10325,32 @@ void Client::Handle_OP_PetitionUnCheckout(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_PlayerStateAdd(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(PlayerState_Struct)) {
|
||||
std::cout << "Wrong size: OP_PlayerStateAdd, size=" << app->size << ", expected " << sizeof(PlayerState_Struct) << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
PlayerState_Struct *ps = (PlayerState_Struct *)app->pBuffer;
|
||||
AddPlayerState(ps->state);
|
||||
|
||||
entity_list.QueueClients(this, app, false);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_PlayerStateRemove(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(PlayerState_Struct)) {
|
||||
std::cout << "Wrong size: OP_PlayerStateRemove, size=" << app->size << ", expected " << sizeof(PlayerState_Struct) << std::endl;
|
||||
return;
|
||||
}
|
||||
PlayerState_Struct *ps = (PlayerState_Struct *)app->pBuffer;
|
||||
RemovePlayerState(ps->state);
|
||||
|
||||
// We should probably save it server side, but for now this works
|
||||
entity_list.QueueClients(this, app, false);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_PickPocket(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(PickPocket_Struct))
|
||||
@ -13891,28 +13917,6 @@ void Client::Handle_OP_WearChange(const EQApplicationPacket *app)
|
||||
return;
|
||||
}
|
||||
|
||||
void Client::Handle_OP_WeaponEquip2(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != 8) {
|
||||
std::cout << "Wrong size: OP_WeaponEquip2, size=" << app->size << ", expected " << 8 << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// We should probably save it server side, but for now this works
|
||||
entity_list.QueueClients(this, app, false);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_WeaponUnequip2(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != 8) {
|
||||
std::cout << "Wrong size: OP_WeaponUnequip2, size=" << app->size << ", expected " << 8 << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
// We should probably save it server side, but for now this works
|
||||
entity_list.QueueClients(this, app, false);
|
||||
}
|
||||
|
||||
void Client::Handle_OP_WhoAllRequest(const EQApplicationPacket *app)
|
||||
{
|
||||
if (app->size != sizeof(Who_All_Struct)) {
|
||||
|
||||
@ -218,6 +218,8 @@
|
||||
void Handle_OP_PetitionRefresh(const EQApplicationPacket *app);
|
||||
void Handle_OP_PetitionResolve(const EQApplicationPacket *app);
|
||||
void Handle_OP_PetitionUnCheckout(const EQApplicationPacket *app);
|
||||
void Handle_OP_PlayerStateAdd(const EQApplicationPacket *app);
|
||||
void Handle_OP_PlayerStateRemove(const EQApplicationPacket *app);
|
||||
void Handle_OP_PickPocket(const EQApplicationPacket *app);
|
||||
void Handle_OP_PopupResponse(const EQApplicationPacket *app);
|
||||
void Handle_OP_PotionBelt(const EQApplicationPacket *app);
|
||||
@ -288,8 +290,6 @@
|
||||
void Handle_OP_VetClaimRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_VoiceMacroIn(const EQApplicationPacket *app);
|
||||
void Handle_OP_WearChange(const EQApplicationPacket *app);
|
||||
void Handle_OP_WeaponEquip2(const EQApplicationPacket *app);
|
||||
void Handle_OP_WeaponUnequip2(const EQApplicationPacket *app);
|
||||
void Handle_OP_WhoAllRequest(const EQApplicationPacket *app);
|
||||
void Handle_OP_XTargetAutoAddHaters(const EQApplicationPacket *app);
|
||||
void Handle_OP_XTargetRequest(const EQApplicationPacket *app);
|
||||
|
||||
@ -18,7 +18,7 @@ Lua_Packet::Lua_Packet(int opcode, int size, bool raw) {
|
||||
if(raw) {
|
||||
SetLuaPtrData(new EQApplicationPacket(OP_Unknown, size));
|
||||
owned_ = true;
|
||||
|
||||
|
||||
EQApplicationPacket *self = reinterpret_cast<EQApplicationPacket*>(d_);
|
||||
self->SetOpcodeBypass(opcode);
|
||||
} else {
|
||||
@ -692,8 +692,8 @@ luabind::scope lua_register_packet_opcodes() {
|
||||
luabind::value("VetClaimRequest", static_cast<int>(OP_VetClaimRequest)),
|
||||
luabind::value("VetClaimReply", static_cast<int>(OP_VetClaimReply)),
|
||||
luabind::value("WeaponEquip1", static_cast<int>(OP_WeaponEquip1)),
|
||||
luabind::value("WeaponEquip2", static_cast<int>(OP_WeaponEquip2)),
|
||||
luabind::value("WeaponUnequip2", static_cast<int>(OP_WeaponUnequip2)),
|
||||
luabind::value("PlayerStateAdd", static_cast<int>(OP_PlayerStateAdd)),
|
||||
luabind::value("PlayerStateRemove", static_cast<int>(OP_PlayerStateRemove)),
|
||||
luabind::value("WorldLogout", static_cast<int>(OP_WorldLogout)),
|
||||
luabind::value("SessionReady", static_cast<int>(OP_SessionReady)),
|
||||
luabind::value("Login", static_cast<int>(OP_Login)),
|
||||
|
||||
26
zone/mob.cpp
26
zone/mob.cpp
@ -148,6 +148,7 @@ Mob::Mob(const char* in_name,
|
||||
size = in_size;
|
||||
base_size = size;
|
||||
runspeed = in_runspeed;
|
||||
PlayerState = 0;
|
||||
|
||||
|
||||
// sanity check
|
||||
@ -160,7 +161,7 @@ Mob::Mob(const char* in_name,
|
||||
m_Light.Level.Spell = m_Light.Type.Spell = 0;
|
||||
m_Light.Type.Active = m_Light.Type.Innate;
|
||||
m_Light.Level.Active = m_Light.Level.Innate;
|
||||
|
||||
|
||||
texture = in_texture;
|
||||
helmtexture = in_helmtexture;
|
||||
armtexture = in_armtexture;
|
||||
@ -739,7 +740,7 @@ void Mob::CreateSpawnPacket(EQApplicationPacket* app, Mob* ForWho) {
|
||||
NewSpawn_Struct* ns = (NewSpawn_Struct*)app->pBuffer;
|
||||
FillSpawnStruct(ns, ForWho);
|
||||
|
||||
if(strlen(ns->spawn.lastName) == 0)
|
||||
if(strlen(ns->spawn.lastName) == 0)
|
||||
{
|
||||
switch(ns->spawn.class_)
|
||||
{
|
||||
@ -915,6 +916,7 @@ void Mob::FillSpawnStruct(NewSpawn_Struct* ns, Mob* ForWho)
|
||||
ns->spawn.class_ = class_;
|
||||
ns->spawn.gender = gender;
|
||||
ns->spawn.level = level;
|
||||
ns->spawn.PlayerState = PlayerState;
|
||||
ns->spawn.deity = deity;
|
||||
ns->spawn.animation = 0;
|
||||
ns->spawn.findable = findable?1:0;
|
||||
@ -2566,10 +2568,10 @@ void Mob::SendArmorAppearance(Client *one_client)
|
||||
if (!IsClient())
|
||||
{
|
||||
const Item_Struct *item;
|
||||
for (int i=0; i< 7 ; ++i)
|
||||
for (int i=0; i< 7 ; ++i)
|
||||
{
|
||||
item=database.GetItem(GetEquipment(i));
|
||||
if (item != 0)
|
||||
if (item != 0)
|
||||
{
|
||||
SendWearChange(i,one_client);
|
||||
}
|
||||
@ -2597,7 +2599,7 @@ void Mob::SendWearChange(uint8 material_slot, Client *one_client)
|
||||
else
|
||||
{
|
||||
one_client->QueuePacket(outapp, false, Client::CLIENT_CONNECTED);
|
||||
}
|
||||
}
|
||||
|
||||
safe_delete(outapp);
|
||||
}
|
||||
@ -2724,7 +2726,7 @@ int32 Mob::GetHerosForgeModel(uint8 material_slot) const
|
||||
const Item_Struct *item;
|
||||
item = database.GetItem(GetEquipment(material_slot));
|
||||
int16 invslot = Inventory::CalcSlotFromMaterial(material_slot);
|
||||
|
||||
|
||||
if (item != 0 && invslot != INVALID_INDEX)
|
||||
{
|
||||
if (IsClient())
|
||||
@ -2982,10 +2984,10 @@ uint32 Mob::GetLevelHP(uint8 tlevel)
|
||||
}
|
||||
|
||||
int32 Mob::GetActSpellCasttime(uint16 spell_id, int32 casttime) {
|
||||
|
||||
|
||||
int32 cast_reducer = 0;
|
||||
cast_reducer += GetFocusEffect(focusSpellHaste, spell_id);
|
||||
|
||||
|
||||
if (level >= 60 && casttime > 1000)
|
||||
{
|
||||
casttime = casttime / 2;
|
||||
@ -3599,7 +3601,7 @@ int16 Mob::GetSkillDmgTaken(const SkillUseTypes skill_used)
|
||||
// All skill dmg mod + Skill specific
|
||||
skilldmg_mod += itembonuses.SkillDmgTaken[HIGHEST_SKILL+1] + spellbonuses.SkillDmgTaken[HIGHEST_SKILL+1] +
|
||||
itembonuses.SkillDmgTaken[skill_used] + spellbonuses.SkillDmgTaken[skill_used];
|
||||
|
||||
|
||||
|
||||
skilldmg_mod += SkillDmgTaken_Mod[skill_used] + SkillDmgTaken_Mod[HIGHEST_SKILL+1];
|
||||
|
||||
@ -5317,7 +5319,7 @@ int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot)
|
||||
|
||||
if (slot < 4){
|
||||
if (id == "components") { return spells[spell_id].components[slot];}
|
||||
else if (id == "component_counts") { return spells[spell_id].component_counts[slot];}
|
||||
else if (id == "component_counts") { return spells[spell_id].component_counts[slot];}
|
||||
else if (id == "NoexpendReagent") {return spells[spell_id].NoexpendReagent[slot];}
|
||||
}
|
||||
|
||||
@ -5395,7 +5397,7 @@ int32 Mob::GetSpellStat(uint32 spell_id, const char *identifier, uint8 slot)
|
||||
else if (id == "max_dist") {return static_cast<int32>(spells[spell_id].max_dist); }
|
||||
else if (id == "min_range") {return static_cast<int32>(spells[spell_id].min_range); }
|
||||
else if (id == "DamageShieldType") {return spells[spell_id].DamageShieldType; }
|
||||
|
||||
|
||||
return stat;
|
||||
}
|
||||
|
||||
@ -5415,7 +5417,7 @@ bool Mob::CanClassEquipItem(uint32 item_id)
|
||||
|
||||
int bitmask = 1;
|
||||
bitmask = bitmask << (GetClass() - 1);
|
||||
|
||||
|
||||
if(!(itm->Classes & bitmask))
|
||||
return false;
|
||||
else
|
||||
|
||||
@ -1026,6 +1026,11 @@ protected:
|
||||
uint32 follow_dist;
|
||||
bool no_target_hotkey;
|
||||
|
||||
uint32 PlayerState;
|
||||
uint32 GetPlayerState() { return PlayerState; }
|
||||
void AddPlayerState(uint32 new_state) { PlayerState |= new_state; }
|
||||
void RemovePlayerState(uint32 old_state) { PlayerState &= ~old_state; }
|
||||
|
||||
uint8 gender;
|
||||
uint16 race;
|
||||
uint8 base_gender;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user