[Server] Add script functions for setting and sending ActorEquipment

0.6.1
David Cernat 8 years ago
parent f47a10dd4a
commit 940a2b6eb5

@ -232,6 +232,18 @@ void ActorFunctions::SetActorFatigueCurrent(double value) noexcept
tempActor.creatureStats.mDynamic[2].mCurrent = value; tempActor.creatureStats.mDynamic[2].mCurrent = value;
} }
void ActorFunctions::EquipActorItem(unsigned short slot, const char *refId, unsigned int count, int charge) noexcept
{
tempActor.equipedItems[slot].refId = refId;
tempActor.equipedItems[slot].count = count;
tempActor.equipedItems[slot].charge = charge;
}
void ActorFunctions::UnequipActorItem(unsigned short slot) noexcept
{
ActorFunctions::EquipActorItem(slot, "", 0, -1);
}
void ActorFunctions::AddActor() noexcept void ActorFunctions::AddActor() noexcept
{ {
writeActorList.baseActors.push_back(tempActor); writeActorList.baseActors.push_back(tempActor);
@ -274,6 +286,12 @@ void ActorFunctions::SendActorStatsDynamic() noexcept
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_STATS_DYNAMIC)->Send(writeActorList.guid); mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_STATS_DYNAMIC)->Send(writeActorList.guid);
} }
void ActorFunctions::SendActorEquipment() noexcept
{
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_EQUIPMENT)->setActorList(&writeActorList);
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_EQUIPMENT)->Send(writeActorList.guid);
}
void ActorFunctions::SendActorCellChange() noexcept void ActorFunctions::SendActorCellChange() noexcept
{ {
mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_CELL_CHANGE)->setActorList(&writeActorList); mwmp::Networking::get().getActorPacketController()->GetPacket(ID_ACTOR_CELL_CHANGE)->setActorList(&writeActorList);

@ -53,12 +53,16 @@
{"SetActorFatigueBase", ActorFunctions::SetActorFatigueBase},\ {"SetActorFatigueBase", ActorFunctions::SetActorFatigueBase},\
{"SetActorFatigueCurrent", ActorFunctions::SetActorFatigueCurrent},\ {"SetActorFatigueCurrent", ActorFunctions::SetActorFatigueCurrent},\
\ \
{"EquipActorItem", ActorFunctions::EquipActorItem},\
{"UnequipActorItem", ActorFunctions::UnequipActorItem},\
\
{"AddActor", ActorFunctions::AddActor},\ {"AddActor", ActorFunctions::AddActor},\
\ \
{"SendActorList", ActorFunctions::SendActorList},\ {"SendActorList", ActorFunctions::SendActorList},\
{"SendActorAuthority", ActorFunctions::SendActorAuthority},\ {"SendActorAuthority", ActorFunctions::SendActorAuthority},\
{"SendActorPosition", ActorFunctions::SendActorPosition},\ {"SendActorPosition", ActorFunctions::SendActorPosition},\
{"SendActorStatsDynamic", ActorFunctions::SendActorStatsDynamic},\ {"SendActorStatsDynamic", ActorFunctions::SendActorStatsDynamic},\
{"SendActorEquipment", ActorFunctions::SendActorEquipment},\
{"SendActorCellChange", ActorFunctions::SendActorCellChange} {"SendActorCellChange", ActorFunctions::SendActorCellChange}
class ActorFunctions class ActorFunctions
@ -116,12 +120,16 @@ public:
static void SetActorFatigueBase(double value) noexcept; static void SetActorFatigueBase(double value) noexcept;
static void SetActorFatigueCurrent(double value) noexcept; static void SetActorFatigueCurrent(double value) noexcept;
static void EquipActorItem(unsigned short slot, const char* refId, unsigned int count, int charge) noexcept;
static void UnequipActorItem(unsigned short slot) noexcept;
static void AddActor() noexcept; static void AddActor() noexcept;
static void SendActorList() noexcept; static void SendActorList() noexcept;
static void SendActorAuthority() noexcept; static void SendActorAuthority() noexcept;
static void SendActorPosition() noexcept; static void SendActorPosition() noexcept;
static void SendActorStatsDynamic() noexcept; static void SendActorStatsDynamic() noexcept;
static void SendActorEquipment() noexcept;
static void SendActorCellChange() noexcept; static void SendActorCellChange() noexcept;
}; };

Loading…
Cancel
Save