mirror of
https://github.com/EQEmu/Server.git
synced 2026-01-22 08:43:51 +00:00
Merge branch 'master' of https://github.com/EQEmu/Server
This commit is contained in:
commit
e11868eb65
File diff suppressed because it is too large
Load Diff
@ -207,6 +207,10 @@
|
||||
#define ServerOP_CZSetEntityVariableByGroupID 0x4022
|
||||
#define ServerOP_CZSetEntityVariableByRaidID 0x4023
|
||||
#define ServerOP_CZSetEntityVariableByGuildID 0x4024
|
||||
#define ServerOP_CZTaskAssign 0x4025
|
||||
#define ServerOP_CZTaskAssignGroup 0x4026
|
||||
#define ServerOP_CZTaskAssignRaid 0x4027
|
||||
#define ServerOP_CZTaskAssignGuild 0x4028
|
||||
|
||||
/**
|
||||
* QueryServer
|
||||
@ -1171,6 +1175,34 @@ struct Server_Speech_Struct {
|
||||
char message[0];
|
||||
};
|
||||
|
||||
struct CZTaskAssign_Struct {
|
||||
uint16 npc_entity_id;
|
||||
int character_id;
|
||||
uint32 task_id;
|
||||
bool enforce_level_requirement;
|
||||
};
|
||||
|
||||
struct CZTaskAssignGroup_Struct {
|
||||
uint16 npc_entity_id;
|
||||
int group_id;
|
||||
uint32 task_id;
|
||||
bool enforce_level_requirement;
|
||||
};
|
||||
|
||||
struct CZTaskAssignRaid_Struct {
|
||||
uint16 npc_entity_id;
|
||||
int raid_id;
|
||||
uint32 task_id;
|
||||
bool enforce_level_requirement;
|
||||
};
|
||||
|
||||
struct CZTaskAssignGuild_Struct {
|
||||
uint16 npc_entity_id;
|
||||
int guild_id;
|
||||
uint32 task_id;
|
||||
bool enforce_level_requirement;
|
||||
};
|
||||
|
||||
struct CZClientSignal_Struct {
|
||||
int charid;
|
||||
uint32 data;
|
||||
|
||||
@ -1251,6 +1251,10 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
||||
case ServerOP_CZSetEntityVariableByGroupID:
|
||||
case ServerOP_CZSetEntityVariableByRaidID:
|
||||
case ServerOP_CZSetEntityVariableByGuildID:
|
||||
case ServerOP_CZTaskAssign:
|
||||
case ServerOP_CZTaskAssignGroup:
|
||||
case ServerOP_CZTaskAssignRaid:
|
||||
case ServerOP_CZTaskAssignGuild:
|
||||
case ServerOP_WWMarquee:
|
||||
case ServerOP_DepopAllPlayersCorpses:
|
||||
case ServerOP_DepopPlayerCorpse:
|
||||
|
||||
@ -633,6 +633,9 @@ public:
|
||||
void MovePC(uint32 zoneID, float x, float y, float z, float heading, uint8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);
|
||||
void MovePC(float x, float y, float z, float heading, uint8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);
|
||||
void MovePC(uint32 zoneID, uint32 instanceID, float x, float y, float z, float heading, uint8 ignorerestrictions = 0, ZoneMode zm = ZoneSolicited);
|
||||
void MoveZone(const char *zone_short_name);
|
||||
void MoveZoneGroup(const char *zone_short_name);
|
||||
void MoveZoneRaid(const char *zone_short_name);
|
||||
void SendToGuildHall();
|
||||
void AssignToInstance(uint16 instance_id);
|
||||
void RemoveFromInstance(uint16 instance_id);
|
||||
@ -948,7 +951,9 @@ public:
|
||||
void DropInst(const EQ::ItemInstance* inst);
|
||||
bool TrainDiscipline(uint32 itemid);
|
||||
void TrainDiscBySpellID(int32 spell_id);
|
||||
uint32 GetDisciplineTimer(uint32 timer_id);
|
||||
int GetDiscSlotBySpellID(int32 spellid);
|
||||
void ResetDisciplineTimer(uint32 timer_id);
|
||||
void SendDisciplineUpdate();
|
||||
void SendDisciplineTimer(uint32 timer_id, uint32 duration);
|
||||
bool UseDiscipline(uint32 spell_id, uint32 target);
|
||||
|
||||
@ -660,6 +660,23 @@ bool Client::UseDiscipline(uint32 spell_id, uint32 target) {
|
||||
return(true);
|
||||
}
|
||||
|
||||
uint32 Client::GetDisciplineTimer(uint32 timer_id) {
|
||||
pTimerType disc_timer_id = pTimerDisciplineReuseStart + timer_id;
|
||||
uint32 disc_timer = 0;
|
||||
if (GetPTimers().Enabled((uint32)disc_timer_id)) {
|
||||
disc_timer = GetPTimers().GetRemainingTime(disc_timer_id);
|
||||
}
|
||||
return disc_timer;
|
||||
}
|
||||
|
||||
void Client::ResetDisciplineTimer(uint32 timer_id) {
|
||||
pTimerType disc_timer_id = pTimerDisciplineReuseStart + timer_id;
|
||||
if (GetPTimers().Enabled((uint32)disc_timer_id)) {
|
||||
GetPTimers().Clear(&database, (uint32)disc_timer_id);
|
||||
}
|
||||
SendDisciplineTimer(timer_id, 0);
|
||||
}
|
||||
|
||||
void Client::SendDisciplineTimer(uint32 timer_id, uint32 duration)
|
||||
{
|
||||
if (timer_id < MAX_DISCIPLINE_TIMERS)
|
||||
|
||||
@ -3741,6 +3741,82 @@ XS(XS__GetTimeSeconds) {
|
||||
XSRETURN_UV(seconds);
|
||||
}
|
||||
|
||||
XS(XS__crosszoneassigntaskbycharid);
|
||||
XS(XS__crosszoneassigntaskbycharid) {
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: quest::crosszoneassigntaskbycharid(int character_id, uint32 task_id, [bool enforce_level_requirement = false])");
|
||||
{
|
||||
int character_id = (int) SvIV(ST(0));
|
||||
uint32 task_id = (uint32) SvIV(ST(1));
|
||||
bool enforce_level_requirement = false;
|
||||
|
||||
if (items == 3) {
|
||||
enforce_level_requirement = (bool) SvTRUE(ST(2));
|
||||
}
|
||||
|
||||
quest_manager.CrossZoneAssignTaskByCharID(character_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__crosszoneassigntaskbygroupid);
|
||||
XS(XS__crosszoneassigntaskbygroupid) {
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: quest::crosszoneassigntaskbygroupid(int group_id, uint32 task_id, [bool enforce_level_requirement = false])");
|
||||
{
|
||||
int group_id = (int) SvIV(ST(0));
|
||||
uint32 task_id = (uint32) SvIV(ST(1));
|
||||
bool enforce_level_requirement = false;
|
||||
|
||||
if (items == 3) {
|
||||
enforce_level_requirement = (bool) SvTRUE(ST(2));
|
||||
}
|
||||
|
||||
quest_manager.CrossZoneAssignTaskByGroupID(group_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__crosszoneassigntaskbyraidid);
|
||||
XS(XS__crosszoneassigntaskbyraidid) {
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: quest::crosszoneassigntaskbyraidid(int raid_id, uint32 task_id, [bool enforce_level_requirement = false])");\
|
||||
{
|
||||
int raid_id = (int) SvIV(ST(0));
|
||||
uint32 task_id = (uint32) SvIV(ST(1));
|
||||
bool enforce_level_requirement = false;
|
||||
|
||||
if (items == 3) {
|
||||
enforce_level_requirement = (bool) SvTRUE(ST(2));
|
||||
}
|
||||
|
||||
quest_manager.CrossZoneAssignTaskByRaidID(raid_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__crosszoneassigntaskbyguildid);
|
||||
XS(XS__crosszoneassigntaskbyguildid) {
|
||||
dXSARGS;
|
||||
if (items < 2 || items > 3)
|
||||
Perl_croak(aTHX_ "Usage: quest::crosszoneassigntaskbyguildid(int guild_id, uint32 task_id, [bool enforce_level_requirement = false])");
|
||||
{
|
||||
int guild_id = (int) SvIV(ST(0));
|
||||
uint32 task_id = (uint32) SvIV(ST(1));
|
||||
bool enforce_level_requirement = false;
|
||||
|
||||
if (items == 3) {
|
||||
enforce_level_requirement = (bool) SvTRUE(ST(2));
|
||||
}
|
||||
quest_manager.CrossZoneAssignTaskByGuildID(guild_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS__crosszonesignalclientbycharid);
|
||||
XS(XS__crosszonesignalclientbycharid) {
|
||||
dXSARGS;
|
||||
@ -4366,6 +4442,10 @@ EXTERN_C XS(boot_quest) {
|
||||
newXS(strcpy(buf, "creategroundobject"), XS__CreateGroundObject, file);
|
||||
newXS(strcpy(buf, "creategroundobjectfrommodel"), XS__CreateGroundObjectFromModel, file);
|
||||
newXS(strcpy(buf, "createguild"), XS__createguild, file);
|
||||
newXS(strcpy(buf, "crosszoneassigntaskbycharid"), XS__crosszoneassigntaskbycharid, file);
|
||||
newXS(strcpy(buf, "crosszoneassigntaskbygroupid"), XS__crosszoneassigntaskbygroupid, file);
|
||||
newXS(strcpy(buf, "crosszoneassigntaskbyraidid"), XS__crosszoneassigntaskbyraidid, file);
|
||||
newXS(strcpy(buf, "crosszoneassigntaskbyguildid"), XS__crosszoneassigntaskbyguildid, file);
|
||||
newXS(strcpy(buf, "crosszonemessageplayerbyname"), XS__crosszonemessageplayerbyname, file);
|
||||
newXS(strcpy(buf, "crosszonemessageplayerbygroupid"), XS__crosszonemessageplayerbygroupid, file);
|
||||
newXS(strcpy(buf, "crosszonemessageplayerbyraidid"), XS__crosszonemessageplayerbyraidid, file);
|
||||
|
||||
@ -325,6 +325,21 @@ void Lua_Client::MovePCInstance(int zone, int instance, float x, float y, float
|
||||
self->MovePC(zone, instance, x, y, z, heading);
|
||||
}
|
||||
|
||||
void Lua_Client::MoveZone(const char *zone_short_name) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MoveZone(zone_short_name);
|
||||
}
|
||||
|
||||
void Lua_Client::MoveZoneGroup(const char *zone_short_name) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MoveZoneGroup(zone_short_name);
|
||||
}
|
||||
|
||||
void Lua_Client::MoveZoneRaid(const char *zone_short_name) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->MoveZoneRaid(zone_short_name);
|
||||
}
|
||||
|
||||
void Lua_Client::ChangeLastName(const char *in) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ChangeLastName(in);
|
||||
@ -845,6 +860,16 @@ void Lua_Client::ResetTrade() {
|
||||
self->ResetTrade();
|
||||
}
|
||||
|
||||
uint32 Lua_Client::GetDisciplineTimer(uint32 timer_id) {
|
||||
Lua_Safe_Call_Int();
|
||||
return self->GetDisciplineTimer(timer_id);
|
||||
}
|
||||
|
||||
void Lua_Client::ResetDisciplineTimer(uint32 timer_id) {
|
||||
Lua_Safe_Call_Void();
|
||||
self->ResetDisciplineTimer(timer_id);
|
||||
}
|
||||
|
||||
bool Lua_Client::UseDiscipline(int spell_id, int target_id) {
|
||||
Lua_Safe_Call_Bool();
|
||||
return self->UseDiscipline(spell_id, target_id);
|
||||
@ -1648,6 +1673,9 @@ luabind::scope lua_register_client() {
|
||||
.def("SetSecondaryWeaponOrnamentation", (void(Lua_Client::*)(uint32))&Lua_Client::SetSecondaryWeaponOrnamentation)
|
||||
.def("MovePC", (void(Lua_Client::*)(int,float,float,float,float))&Lua_Client::MovePC)
|
||||
.def("MovePCInstance", (void(Lua_Client::*)(int,int,float,float,float,float))&Lua_Client::MovePCInstance)
|
||||
.def("MoveZone", (void(Lua_Client::*)(const char*))&Lua_Client::MoveZone)
|
||||
.def("MoveZoneGroup", (void(Lua_Client::*)(const char*))&Lua_Client::MoveZoneGroup)
|
||||
.def("MoveZoneRaid", (void(Lua_Client::*)(const char*))&Lua_Client::MoveZoneRaid)
|
||||
.def("ChangeLastName", (void(Lua_Client::*)(const char *in))&Lua_Client::ChangeLastName)
|
||||
.def("GetFactionLevel", (int(Lua_Client::*)(uint32,uint32,uint32,uint32,uint32,uint32,Lua_NPC))&Lua_Client::GetFactionLevel)
|
||||
.def("SetFactionLevel", (void(Lua_Client::*)(uint32,uint32,int,int,int))&Lua_Client::SetFactionLevel)
|
||||
@ -1752,6 +1780,8 @@ luabind::scope lua_register_client() {
|
||||
.def("ForageItem", (void(Lua_Client::*)(bool))&Lua_Client::ForageItem)
|
||||
.def("CalcPriceMod", (float(Lua_Client::*)(Lua_Mob,bool))&Lua_Client::CalcPriceMod)
|
||||
.def("ResetTrade", (void(Lua_Client::*)(void))&Lua_Client::ResetTrade)
|
||||
.def("GetDisciplineTimer", (uint32(Lua_Client::*)(uint32))&Lua_Client::GetDisciplineTimer)
|
||||
.def("ResetDisciplineTimer", (void(Lua_Client::*)(uint32))&Lua_Client::ResetDisciplineTimer)
|
||||
.def("UseDiscipline", (bool(Lua_Client::*)(int,int))&Lua_Client::UseDiscipline)
|
||||
.def("GetCharacterFactionLevel", (int(Lua_Client::*)(int))&Lua_Client::GetCharacterFactionLevel)
|
||||
.def("SetZoneFlag", (void(Lua_Client::*)(int))&Lua_Client::SetZoneFlag)
|
||||
|
||||
@ -91,6 +91,9 @@ public:
|
||||
uint32 GetBindZoneID(int index);
|
||||
void MovePC(int zone, float x, float y, float z, float heading);
|
||||
void MovePCInstance(int zone, int instance, float x, float y, float z, float heading);
|
||||
void MoveZone(const char *zone_short_name);
|
||||
void MoveZoneGroup(const char *zone_short_name);
|
||||
void MoveZoneRaid(const char *zone_short_name);
|
||||
void ChangeLastName(const char *in);
|
||||
int GetFactionLevel(uint32 char_id, uint32 npc_id, uint32 race, uint32 class_, uint32 deity, uint32 faction, Lua_NPC npc);
|
||||
void SetFactionLevel(uint32 char_id, uint32 npc_id, int char_class, int char_race, int char_deity);
|
||||
@ -196,6 +199,8 @@ public:
|
||||
void ForageItem(bool guarantee);
|
||||
float CalcPriceMod(Lua_Mob other, bool reverse);
|
||||
void ResetTrade();
|
||||
uint32 GetDisciplineTimer(uint32 timer_id);
|
||||
void ResetDisciplineTimer(uint32 timer_id);
|
||||
bool UseDiscipline(int spell_id, int target_id);
|
||||
int GetCharacterFactionLevel(int faction_id);
|
||||
void SetZoneFlag(int zone_id);
|
||||
|
||||
@ -1022,6 +1022,38 @@ void lua_send_mail(const char *to, const char *from, const char *subject, const
|
||||
quest_manager.SendMail(to, from, subject, message);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_char_id(int character_id, uint32 task_id) {
|
||||
quest_manager.CrossZoneAssignTaskByCharID(character_id, task_id);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_char_id(int character_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
quest_manager.CrossZoneAssignTaskByCharID(character_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_group_id(int group_id, uint32 task_id) {
|
||||
quest_manager.CrossZoneAssignTaskByGroupID(group_id, task_id);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_group_id(int group_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
quest_manager.CrossZoneAssignTaskByGroupID(group_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_raid_id(int raid_id, uint32 task_id) {
|
||||
quest_manager.CrossZoneAssignTaskByRaidID(raid_id, task_id);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_raid_id(int raid_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
quest_manager.CrossZoneAssignTaskByRaidID(raid_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_guild_id(int guild_id, uint32 task_id) {
|
||||
quest_manager.CrossZoneAssignTaskByGuildID(guild_id, task_id);
|
||||
}
|
||||
|
||||
void lua_cross_zone_assign_task_by_guild_id(int guild_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
quest_manager.CrossZoneAssignTaskByGuildID(guild_id, task_id, enforce_level_requirement);
|
||||
}
|
||||
|
||||
void lua_cross_zone_signal_client_by_char_id(uint32 player_id, int signal) {
|
||||
quest_manager.CrossZoneSignalPlayerByCharID(player_id, signal);
|
||||
}
|
||||
@ -1886,6 +1918,14 @@ luabind::scope lua_register_general() {
|
||||
luabind::def("wear_change", &lua_wear_change),
|
||||
luabind::def("voice_tell", &lua_voice_tell),
|
||||
luabind::def("send_mail", &lua_send_mail),
|
||||
luabind::def("cross_zone_assign_task_by_char_id", (void(*)(int,uint32))&lua_cross_zone_assign_task_by_char_id),
|
||||
luabind::def("cross_zone_assign_task_by_char_id", (void(*)(int,uint32,bool))&lua_cross_zone_assign_task_by_char_id),
|
||||
luabind::def("cross_zone_assign_task_by_group_id", (void(*)(int,uint32))&lua_cross_zone_assign_task_by_group_id),
|
||||
luabind::def("cross_zone_assign_task_by_group_id", (void(*)(int,uint32,bool))&lua_cross_zone_assign_task_by_group_id),
|
||||
luabind::def("cross_zone_assign_task_by_raid_id", (void(*)(int,uint32))&lua_cross_zone_assign_task_by_raid_id),
|
||||
luabind::def("cross_zone_assign_task_by_raid_id", (void(*)(int,uint32,bool))&lua_cross_zone_assign_task_by_raid_id),
|
||||
luabind::def("cross_zone_assign_task_by_guild_id", (void(*)(int,uint32))&lua_cross_zone_assign_task_by_guild_id),
|
||||
luabind::def("cross_zone_assign_task_by_guild_id", (void(*)(int,uint32,bool))&lua_cross_zone_assign_task_by_guild_id),
|
||||
luabind::def("cross_zone_signal_client_by_char_id", &lua_cross_zone_signal_client_by_char_id),
|
||||
luabind::def("cross_zone_signal_client_by_group_id", &lua_cross_zone_signal_client_by_group_id),
|
||||
luabind::def("cross_zone_signal_client_by_raid_id", &lua_cross_zone_signal_client_by_raid_id),
|
||||
|
||||
@ -1319,6 +1319,132 @@ XS(XS_Client_MovePCInstance) {
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_MoveZone); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_MoveZone) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::MoveZone(THIS, string zone_short_name)");
|
||||
{
|
||||
Client *THIS;
|
||||
const char *zone_short_name = (const char *) SvPV_nolen(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
if (THIS->IsClient()) {
|
||||
THIS->MoveZone(zone_short_name);
|
||||
} else {
|
||||
if (THIS->IsMerc()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZone) attempted to process a type Merc reference");
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZone) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else if (THIS->IsNPC()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZone) attempted to process a type NPC reference");
|
||||
}
|
||||
else {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZone) attempted to process an Unknown type reference");
|
||||
}
|
||||
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
}
|
||||
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_MoveZoneGroup); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_MoveZoneGroup) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::MoveZoneGroup(THIS, string zone_short_name)");
|
||||
{
|
||||
Client *THIS;
|
||||
const char *zone_short_name = (const char *) SvPV_nolen(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
if (THIS->IsClient()) {
|
||||
THIS->MoveZoneGroup(zone_short_name);
|
||||
} else {
|
||||
if (THIS->IsMerc()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneGroup) attempted to process a type Merc reference");
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneGroup) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else if (THIS->IsNPC()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneGroup) attempted to process a type NPC reference");
|
||||
}
|
||||
else {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneGroup) attempted to process an Unknown type reference");
|
||||
}
|
||||
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
}
|
||||
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_MoveZoneRaid); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_MoveZoneRaid) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::MoveZoneRaid(THIS, string zone_short_name)");
|
||||
{
|
||||
Client *THIS;
|
||||
const char *zone_short_name = (const char *) SvPV_nolen(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
if (THIS->IsClient()) {
|
||||
THIS->MoveZoneRaid(zone_short_name);
|
||||
} else {
|
||||
if (THIS->IsMerc()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneRaid) attempted to process a type Merc reference");
|
||||
}
|
||||
#ifdef BOTS
|
||||
else if (THIS->IsBot()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneRaid) attempted to process a type Bot reference");
|
||||
}
|
||||
#endif
|
||||
else if (THIS->IsNPC()) {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneRaid) attempted to process a type NPC reference");
|
||||
}
|
||||
else {
|
||||
LogDebug("[CLIENT] Perl(XS_Client_MoveZoneRaid) attempted to process an Unknown type reference");
|
||||
}
|
||||
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
}
|
||||
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_ChangeLastName); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_ChangeLastName) {
|
||||
dXSARGS;
|
||||
@ -3670,6 +3796,54 @@ XS(XS_Client_UseDiscipline) {
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_GetDisciplineTimer); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_GetDisciplineTimer) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::GetDisciplineTimer(THIS, uint32 timer_id)");
|
||||
{
|
||||
Client *THIS;
|
||||
uint32 RETVAL;
|
||||
dXSTARG;
|
||||
uint32 timer_id = (uint32) SvUV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
RETVAL = THIS->GetDisciplineTimer(timer_id);
|
||||
XSprePUSH;
|
||||
PUSHu((UV) RETVAL);
|
||||
}
|
||||
XSRETURN(1);
|
||||
}
|
||||
|
||||
XS(XS_Client_ResetDisciplineTimer); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_ResetDisciplineTimer) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
Perl_croak(aTHX_ "Usage: Client::ResetDisciplineTimer(THIS, uint32 timer_id)");
|
||||
{
|
||||
Client *THIS;
|
||||
uint32 timer_id = (uint32) SvUV(ST(1));
|
||||
|
||||
if (sv_derived_from(ST(0), "Client")) {
|
||||
IV tmp = SvIV((SV *) SvRV(ST(0)));
|
||||
THIS = INT2PTR(Client *, tmp);
|
||||
} else
|
||||
Perl_croak(aTHX_ "THIS is not of type Client");
|
||||
if (THIS == nullptr)
|
||||
Perl_croak(aTHX_ "THIS is nullptr, avoiding crash.");
|
||||
|
||||
THIS->ResetDisciplineTimer(timer_id);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_Client_GetCharacterFactionLevel); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_Client_GetCharacterFactionLevel) {
|
||||
dXSARGS;
|
||||
@ -6451,6 +6625,7 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "GetCorpseID"), XS_Client_GetCorpseID, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetCorpseItemAt"), XS_Client_GetCorpseItemAt, file, "$$$");
|
||||
newXSproto(strcpy(buf, "GetCustomItemData"), XS_Client_GetCustomItemData, file, "$$$");
|
||||
newXSproto(strcpy(buf, "GetDisciplineTimer"), XS_Client_GetDisciplineTimer, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetDiscSlotBySpellID"), XS_Client_GetDiscSlotBySpellID, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetDuelTarget"), XS_Client_GetDuelTarget, file, "$");
|
||||
newXSproto(strcpy(buf, "GetEbonCrystals"), XS_Client_GetEbonCrystals, file, "$");
|
||||
@ -6537,6 +6712,9 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "MemSpell"), XS_Client_MemSpell, file, "$$$;$");
|
||||
newXSproto(strcpy(buf, "MovePC"), XS_Client_MovePC, file, "$$$$$$");
|
||||
newXSproto(strcpy(buf, "MovePCInstance"), XS_Client_MovePCInstance, file, "$$$$$$$");
|
||||
newXSproto(strcpy(buf, "MoveZone"), XS_Client_MoveZone, file, "$$");
|
||||
newXSproto(strcpy(buf, "MoveZoneGroup"), XS_Client_MoveZoneGroup, file, "$$");
|
||||
newXSproto(strcpy(buf, "MoveZoneRaid"), XS_Client_MoveZoneRaid, file, "$$");
|
||||
newXSproto(strcpy(buf, "NPCSpawn"), XS_Client_NPCSpawn, file, "$$$;$");
|
||||
newXSproto(strcpy(buf, "NukeItem"), XS_Client_NukeItem, file, "$$;$");
|
||||
newXSproto(strcpy(buf, "OpenLFGuildWindow"), XS_Client_OpenLFGuildWindow, file, "$");
|
||||
@ -6548,6 +6726,7 @@ XS(boot_Client) {
|
||||
newXSproto(strcpy(buf, "RefundAA"), XS_Client_RefundAA, file, "$$");
|
||||
newXSproto(strcpy(buf, "RemoveNoRent"), XS_Client_RemoveNoRent, file, "$");
|
||||
newXSproto(strcpy(buf, "ResetAA"), XS_Client_ResetAA, file, "$");
|
||||
newXSproto(strcpy(buf, "ResetDisciplineTimer"), XS_Client_ResetDisciplineTimer, file, "$$");
|
||||
newXSproto(strcpy(buf, "ResetTrade"), XS_Client_ResetTrade, file, "$");
|
||||
newXSproto(strcpy(buf, "Save"), XS_Client_Save, file, "$$");
|
||||
newXSproto(strcpy(buf, "SaveBackup"), XS_Client_SaveBackup, file, "$");
|
||||
|
||||
@ -2479,7 +2479,7 @@ XS(XS_NPC_SetSimpleRoamBox) {
|
||||
XS(XS_NPC_RecalculateSkills); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_NPC_RecalculateSkills) {
|
||||
dXSARGS;
|
||||
if (items != 2)
|
||||
if (items != 1)
|
||||
Perl_croak(aTHX_ "Usage: NPC::RecalculateSkills(THIS)");
|
||||
{
|
||||
NPC *THIS;
|
||||
|
||||
@ -3271,6 +3271,62 @@ const char* QuestManager::GetZoneLongName(const char *zone) {
|
||||
return ln.c_str();
|
||||
}
|
||||
|
||||
void QuestManager::CrossZoneAssignTaskByCharID(int character_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && initiator && owner) {
|
||||
auto pack = new ServerPacket(ServerOP_CZTaskAssign, sizeof(CZTaskAssign_Struct));
|
||||
CZTaskAssign_Struct* CZTA = (CZTaskAssign_Struct*)pack->pBuffer;
|
||||
CZTA->npc_entity_id = owner->GetID();
|
||||
CZTA->character_id = character_id;
|
||||
CZTA->task_id = task_id;
|
||||
CZTA->enforce_level_requirement = enforce_level_requirement;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::CrossZoneAssignTaskByGroupID(int group_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && initiator && owner) {
|
||||
auto pack = new ServerPacket(ServerOP_CZTaskAssignGroup, sizeof(CZTaskAssignGroup_Struct));
|
||||
CZTaskAssignGroup_Struct* CZTA = (CZTaskAssignGroup_Struct*)pack->pBuffer;
|
||||
CZTA->npc_entity_id = owner->GetID();
|
||||
CZTA->group_id = group_id;
|
||||
CZTA->task_id = task_id;
|
||||
CZTA->enforce_level_requirement = enforce_level_requirement;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::CrossZoneAssignTaskByRaidID(int raid_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && initiator && owner) {
|
||||
auto pack = new ServerPacket(ServerOP_CZTaskAssignRaid, sizeof(CZTaskAssignRaid_Struct));
|
||||
CZTaskAssignRaid_Struct* CZTA = (CZTaskAssignRaid_Struct*) pack->pBuffer;
|
||||
CZTA->npc_entity_id = owner->GetID();
|
||||
CZTA->raid_id = raid_id;
|
||||
CZTA->task_id = task_id;
|
||||
CZTA->enforce_level_requirement = enforce_level_requirement;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::CrossZoneAssignTaskByGuildID(int guild_id, uint32 task_id, bool enforce_level_requirement) {
|
||||
QuestManagerCurrentQuestVars();
|
||||
if (RuleB(TaskSystem, EnableTaskSystem) && initiator && owner) {
|
||||
auto pack = new ServerPacket(ServerOP_CZTaskAssignGuild, sizeof(CZTaskAssignGuild_Struct));
|
||||
CZTaskAssignGuild_Struct* CZTA = (CZTaskAssignGuild_Struct*) pack->pBuffer;
|
||||
CZTA->npc_entity_id = owner->GetID();
|
||||
CZTA->guild_id = guild_id;
|
||||
CZTA->task_id = task_id;
|
||||
CZTA->enforce_level_requirement = enforce_level_requirement;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
}
|
||||
|
||||
void QuestManager::CrossZoneSignalNPCByNPCTypeID(uint32 npctype_id, uint32 data){
|
||||
auto pack = new ServerPacket(ServerOP_CZSignalNPC, sizeof(CZNPCSignal_Struct));
|
||||
CZNPCSignal_Struct* CZSN = (CZNPCSignal_Struct*)pack->pBuffer;
|
||||
|
||||
@ -280,6 +280,10 @@ public:
|
||||
uint16 CreateDoor( const char* model, float x, float y, float z, float heading, uint8 opentype, uint16 size);
|
||||
int32 GetZoneID(const char *zone);
|
||||
const char *GetZoneLongName(const char *zone);
|
||||
void CrossZoneAssignTaskByCharID(int character_id, uint32 task_id, bool enforce_level_requirement = false);
|
||||
void CrossZoneAssignTaskByGroupID(int group_id, uint32 task_id, bool enforce_level_requirement = false);
|
||||
void CrossZoneAssignTaskByRaidID(int raid_id, uint32 task_id, bool enforce_level_requirement = false);
|
||||
void CrossZoneAssignTaskByGuildID(int guild_id, uint32 task_id, bool enforce_level_requirement = false);
|
||||
void CrossZoneSignalPlayerByCharID(int charid, uint32 data);
|
||||
void CrossZoneSignalPlayerByGroupID(int group_id, uint32 data);
|
||||
void CrossZoneSignalPlayerByRaidID(int raid_id, uint32 data);
|
||||
|
||||
@ -3308,18 +3308,13 @@ void ClientTaskState::AcceptNewTask(Client *c, int TaskID, int NPCID, bool enfor
|
||||
|
||||
taskmanager->SendSingleActiveTaskToClient(c, *active_slot, false, true);
|
||||
c->Message(Chat::White, "You have been assigned the task '%s'.", taskmanager->Tasks[TaskID]->Title.c_str());
|
||||
|
||||
taskmanager->SaveClientState(c, this);
|
||||
std::string buf = std::to_string(TaskID);
|
||||
|
||||
NPC *npc = entity_list.GetID(NPCID)->CastToNPC();
|
||||
if(!npc) {
|
||||
c->Message(Chat::Yellow, "Task Giver ID is %i", NPCID);
|
||||
c->Message(Chat::Red, "Unable to find NPC to send EVENT_TASKACCEPTED to. Report this bug.");
|
||||
return;
|
||||
if(npc) {
|
||||
parse->EventNPC(EVENT_TASK_ACCEPTED, npc, c, buf.c_str(), 0);
|
||||
}
|
||||
|
||||
taskmanager->SaveClientState(c, this);
|
||||
parse->EventNPC(EVENT_TASK_ACCEPTED, npc, c, buf.c_str(), 0);
|
||||
}
|
||||
|
||||
void ClientTaskState::ProcessTaskProximities(Client *c, float X, float Y, float Z) {
|
||||
|
||||
@ -2041,6 +2041,49 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_CZTaskAssign:
|
||||
{
|
||||
CZTaskAssign_Struct* CZTA = (CZTaskAssign_Struct*)pack->pBuffer;
|
||||
auto client_list = entity_list.GetClientList();
|
||||
Client* client = entity_list.GetClientByCharID(CZTA->character_id);
|
||||
if (client != 0) {
|
||||
client->AssignTask(CZTA->task_id, CZTA->npc_entity_id, CZTA->enforce_level_requirement);
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_CZTaskAssignGroup:
|
||||
{
|
||||
CZTaskAssignGroup_Struct* CZTA = (CZTaskAssignGroup_Struct*)pack->pBuffer;
|
||||
auto client_list = entity_list.GetClientList();
|
||||
for (auto client : client_list) {
|
||||
if (client.second->GetGroup() && client.second->GetGroup()->GetID() == CZTA->group_id) {
|
||||
client.second->AssignTask(CZTA->task_id, CZTA->npc_entity_id, CZTA->enforce_level_requirement);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_CZTaskAssignRaid:
|
||||
{
|
||||
CZTaskAssignRaid_Struct* CZTA = (CZTaskAssignRaid_Struct*)pack->pBuffer;
|
||||
auto client_list = entity_list.GetClientList();
|
||||
for (auto client : client_list) {
|
||||
if (client.second->GetRaid() && client.second->GetRaid()->GetID() == CZTA->raid_id) {
|
||||
client.second->AssignTask(CZTA->task_id, CZTA->npc_entity_id, CZTA->enforce_level_requirement);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_CZTaskAssignGuild:
|
||||
{
|
||||
CZTaskAssignGuild_Struct* CZTA = (CZTaskAssignGuild_Struct*)pack->pBuffer;
|
||||
auto client_list = entity_list.GetClientList();
|
||||
for (auto client : client_list) {
|
||||
if (client.second->GuildID() > 0 && client.second->GuildID() == CZTA->guild_id) {
|
||||
client.second->AssignTask(CZTA->task_id, CZTA->npc_entity_id, CZTA->enforce_level_requirement);
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case ServerOP_WWMarquee:
|
||||
{
|
||||
WWMarquee_Struct* WWMS = (WWMarquee_Struct*)pack->pBuffer;
|
||||
|
||||
@ -418,6 +418,48 @@ void Client::MovePC(uint32 zoneID, uint32 instanceID, float x, float y, float z,
|
||||
ProcessMovePC(zoneID, instanceID, x, y, z, heading, ignorerestrictions, zm);
|
||||
}
|
||||
|
||||
void Client::MoveZone(const char *zone_short_name) {
|
||||
auto pack = new ServerPacket(ServerOP_ZoneToZoneRequest, sizeof(ZoneToZone_Struct));
|
||||
ZoneToZone_Struct* ztz = (ZoneToZone_Struct*) pack->pBuffer;
|
||||
ztz->response = 0;
|
||||
ztz->current_zone_id = zone->GetZoneID();
|
||||
ztz->current_instance_id = zone->GetInstanceID();
|
||||
ztz->requested_zone_id = database.GetZoneID(zone_short_name);
|
||||
ztz->admin = Admin();
|
||||
strcpy(ztz->name, GetName());
|
||||
ztz->guild_id = GuildID();
|
||||
ztz->ignorerestrictions = 3;
|
||||
worldserver.SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
}
|
||||
|
||||
void Client::MoveZoneGroup(const char *zone_short_name) {
|
||||
if (!GetGroup()) {
|
||||
MoveZone(zone_short_name);
|
||||
} else {
|
||||
auto client_group = GetGroup();
|
||||
for (int member_index = 0; member_index < MAX_GROUP_MEMBERS; member_index++) {
|
||||
if (client_group->members[member_index] && client_group->members[member_index]->IsClient()) {
|
||||
auto group_member = client_group->members[member_index]->CastToClient();
|
||||
group_member->MoveZone(zone_short_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client::MoveZoneRaid(const char *zone_short_name) {
|
||||
if (!GetRaid()) {
|
||||
MoveZone(zone_short_name);
|
||||
} else {
|
||||
auto client_raid = GetRaid();
|
||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
||||
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||
raid_member->MoveZone(zone_short_name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Client::ProcessMovePC(uint32 zoneID, uint32 instance_id, float x, float y, float z, float heading, uint8 ignorerestrictions, ZoneMode zm)
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user