mirror of
https://github.com/EQEmu/Server.git
synced 2025-12-15 12:31:31 +00:00
[Quest API] Add cross zone and world wide dialogue windows to Perl/Lua. (#1599)
* [Quest API] Add cross zone and world wide dialogue windows to Perl/Lua. - Add quest::crosszonedialoguewindowbycharid(character_id, message) to Perl. - Add quest::crosszonedialoguewindowbygroupid(group_id, message) to Perl. - Add quest::crosszonedialoguewindowbyraidid(raid_id, message) to Perl. - Add quest::crosszonedialoguewindowbyguildid(guild_id, message) to Perl. - Add quest::crosszonedialoguewindowbyexpeditionid(expedition_id, message) to Perl. - Add quest::crosszonedialoguewindowbyclientname(client_name, message) to Perl. - Add quest::worldwidedialoguewindow(message, min_status, max_status) to Perl. - Add eq.cross_zone_dialogue_window_by_char_id(character_id, message) to Lua. - Add eq.cross_zone_dialogue_window_by_group_id(group_id, message) to Lua. - Add eq.cross_zone_dialogue_window_by_raid_id(raid_id, message) to Lua. - Add eq.cross_zone_dialogue_window_by_guild_id(guild_id, message) to Lua. - Add eq.cross_zone_dialogue_window_by_expedition_id(expedition_id, message) to Lua. - Add eq.cross_zone_dialogue_window_by_client_name(client_name, message) to Lua. - Add eq.world_wide_dialogue_window(message, min_status, max_status) to Lua. * Use string instead.
This commit is contained in:
parent
9887580f9a
commit
91adf9c0eb
@ -227,24 +227,26 @@
|
|||||||
#define ServerOP_HotReloadQuests 0x4011
|
#define ServerOP_HotReloadQuests 0x4011
|
||||||
#define ServerOP_UpdateSchedulerEvents 0x4012
|
#define ServerOP_UpdateSchedulerEvents 0x4012
|
||||||
|
|
||||||
#define ServerOP_CZLDoNUpdate 0x4500
|
#define ServerOP_CZDialogueWindow 0x4500
|
||||||
#define ServerOP_CZMarquee 0x4501
|
#define ServerOP_CZLDoNUpdate 0x4501
|
||||||
#define ServerOP_CZMessage 0x4502
|
#define ServerOP_CZMarquee 0x4502
|
||||||
#define ServerOP_CZMove 0x4503
|
#define ServerOP_CZMessage 0x4503
|
||||||
#define ServerOP_CZSetEntityVariable 0x4504
|
#define ServerOP_CZMove 0x4504
|
||||||
#define ServerOP_CZSignal 0x4505
|
#define ServerOP_CZSetEntityVariable 0x4505
|
||||||
#define ServerOP_CZSpell 0x4506
|
#define ServerOP_CZSignal 0x4506
|
||||||
#define ServerOP_CZTaskUpdate 0x4507
|
#define ServerOP_CZSpell 0x4507
|
||||||
#define ServerOP_CZClientMessageString 0x4508
|
#define ServerOP_CZTaskUpdate 0x4508
|
||||||
|
#define ServerOP_CZClientMessageString 0x4509
|
||||||
|
|
||||||
#define ServerOP_WWLDoNUpdate 0x4750
|
#define ServerOP_WWDialogueWindow 0x4750
|
||||||
#define ServerOP_WWMarquee 0x4751
|
#define ServerOP_WWLDoNUpdate 0x4751
|
||||||
#define ServerOP_WWMessage 0x4752
|
#define ServerOP_WWMarquee 0x4752
|
||||||
#define ServerOP_WWMove 0x4753
|
#define ServerOP_WWMessage 0x4753
|
||||||
#define ServerOP_WWSetEntityVariable 0x4754
|
#define ServerOP_WWMove 0x4754
|
||||||
#define ServerOP_WWSignal 0x4755
|
#define ServerOP_WWSetEntityVariable 0x4755
|
||||||
#define ServerOP_WWSpell 0x4756
|
#define ServerOP_WWSignal 0x4756
|
||||||
#define ServerOP_WWTaskUpdate 0x4757
|
#define ServerOP_WWSpell 0x4757
|
||||||
|
#define ServerOP_WWTaskUpdate 0x4758
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* QueryServer
|
* QueryServer
|
||||||
@ -1440,6 +1442,13 @@ struct CZClientMessageString_Struct {
|
|||||||
char args[1]; // null delimited
|
char args[1]; // null delimited
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct CZDialogueWindow_Struct {
|
||||||
|
uint8 update_type; // 0 - Character, 1 - Group, 2 - Raid, 3 - Guild, 4 - Expedition, 5 - Character Name
|
||||||
|
int update_identifier; // Character ID, Group ID, Raid ID, Guild ID, or Expedition ID based on update type, 0 for Character Name
|
||||||
|
char message[4096];
|
||||||
|
char client_name[64]; // Only used by Character Name Type, else empty
|
||||||
|
};
|
||||||
|
|
||||||
struct CZLDoNUpdate_Struct {
|
struct CZLDoNUpdate_Struct {
|
||||||
uint8 update_type; // 0 - Character, 1 - Group, 2 - Raid, 3 - Guild, 4 - Expedition, 5 - Character Name
|
uint8 update_type; // 0 - Character, 1 - Group, 2 - Raid, 3 - Guild, 4 - Expedition, 5 - Character Name
|
||||||
uint8 update_subtype; // 0 - Loss, 1 - Points, 2 - Win
|
uint8 update_subtype; // 0 - Loss, 1 - Points, 2 - Win
|
||||||
@ -1512,6 +1521,12 @@ struct CZTaskUpdate_Struct {
|
|||||||
char client_name[64]; // Only used by Character Name Type, else empty
|
char client_name[64]; // Only used by Character Name Type, else empty
|
||||||
};
|
};
|
||||||
|
|
||||||
|
struct WWDialogueWindow_Struct {
|
||||||
|
char message[4096];
|
||||||
|
uint8 min_status;
|
||||||
|
uint8 max_status;
|
||||||
|
};
|
||||||
|
|
||||||
struct WWLDoNUpdate_Struct {
|
struct WWLDoNUpdate_Struct {
|
||||||
uint8 update_type; // 0 - Loss, 1 - Points, 2 - Win
|
uint8 update_type; // 0 - Loss, 1 - Points, 2 - Win
|
||||||
uint32 theme_id;
|
uint32 theme_id;
|
||||||
|
|||||||
@ -1240,6 +1240,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
|||||||
QSLink.SendPacket(pack);
|
QSLink.SendPacket(pack);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ServerOP_CZDialogueWindow:
|
||||||
case ServerOP_CZLDoNUpdate:
|
case ServerOP_CZLDoNUpdate:
|
||||||
case ServerOP_CZMarquee:
|
case ServerOP_CZMarquee:
|
||||||
case ServerOP_CZMessage:
|
case ServerOP_CZMessage:
|
||||||
@ -1248,6 +1249,7 @@ void ZoneServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p) {
|
|||||||
case ServerOP_CZSignal:
|
case ServerOP_CZSignal:
|
||||||
case ServerOP_CZSpell:
|
case ServerOP_CZSpell:
|
||||||
case ServerOP_CZTaskUpdate:
|
case ServerOP_CZTaskUpdate:
|
||||||
|
case ServerOP_WWDialogueWindow:
|
||||||
case ServerOP_WWLDoNUpdate:
|
case ServerOP_WWLDoNUpdate:
|
||||||
case ServerOP_WWMarquee:
|
case ServerOP_WWMarquee:
|
||||||
case ServerOP_WWMessage:
|
case ServerOP_WWMessage:
|
||||||
|
|||||||
@ -5806,6 +5806,91 @@ XS(XS__crosszonecastspellbyclientname) {
|
|||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS__crosszonedialoguewindowbycharid);
|
||||||
|
XS(XS__crosszonedialoguewindowbycharid) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::crosszonedialoguewindowbycharid(int character_id, string message)");
|
||||||
|
{
|
||||||
|
uint8 update_type = CZUpdateType_Character;
|
||||||
|
int character_id = (int) SvIV(ST(0));
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(1));
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, character_id, message);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
XS(XS__crosszonedialoguewindowbygroupid);
|
||||||
|
XS(XS__crosszonedialoguewindowbygroupid) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::crosszonedialoguewindowbygroupid(int group_id, string message)");
|
||||||
|
{
|
||||||
|
uint8 update_type = CZUpdateType_Group;
|
||||||
|
int group_id = (int) SvIV(ST(0));
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(1));
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, group_id, message);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
XS(XS__crosszonedialoguewindowbyraidid);
|
||||||
|
XS(XS__crosszonedialoguewindowbyraidid) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::crosszonedialoguewindowbyraidid(int raid_id, string message)");
|
||||||
|
{
|
||||||
|
uint8 update_type = CZUpdateType_Raid;
|
||||||
|
int raid_id = (int) SvIV(ST(0));
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(1));
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, raid_id, message);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
XS(XS__crosszonedialoguewindowbyguildid);
|
||||||
|
XS(XS__crosszonedialoguewindowbyguildid) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::crosszonedialoguewindowbyguildid(int guild_id, string message)");
|
||||||
|
{
|
||||||
|
uint8 update_type = CZUpdateType_Guild;
|
||||||
|
int guild_id = (int) SvIV(ST(0));
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(1));
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, guild_id, message);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
XS(XS__crosszonedialoguewindowbyexpeditionid);
|
||||||
|
XS(XS__crosszonedialoguewindowbyexpeditionid) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::crosszonedialoguewindowbyexpeditionid(uint32 expedition_id, string message)");
|
||||||
|
{
|
||||||
|
uint8 update_type = CZUpdateType_Expedition;
|
||||||
|
uint32 expedition_id = (uint32) SvUV(ST(0));
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(1));
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, expedition_id, message);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
|
XS(XS__crosszonedialoguewindowbyclientname);
|
||||||
|
XS(XS__crosszonedialoguewindowbyclientname) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items != 2)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::crosszonedialoguewindowbyclientname(const char* client_name, string message)");
|
||||||
|
{
|
||||||
|
uint8 update_type = CZUpdateType_ClientName;
|
||||||
|
int update_identifier = 0;
|
||||||
|
const char* client_name = (const char*) SvPV_nolen(ST(0));
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(1));
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, update_identifier, message, client_name);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS__crosszonedisabletaskbycharid);
|
XS(XS__crosszonedisabletaskbycharid);
|
||||||
XS(XS__crosszonedisabletaskbycharid) {
|
XS(XS__crosszonedisabletaskbycharid) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
@ -7225,6 +7310,26 @@ XS(XS__worldwidecastspell) {
|
|||||||
XSRETURN_EMPTY;
|
XSRETURN_EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
XS(XS__worldwidedialoguewindow);
|
||||||
|
XS(XS__worldwidedialoguewindow) {
|
||||||
|
dXSARGS;
|
||||||
|
if (items < 1 || items > 3)
|
||||||
|
Perl_croak(aTHX_ "Usage: quest::worldwidedialoguewindow(string message, [uint8 min_status = 0, uint8 max_status = 0])");
|
||||||
|
{
|
||||||
|
const char* message = (const char*) SvPV_nolen(ST(0));
|
||||||
|
uint8 min_status = 0;
|
||||||
|
uint8 max_status = 0;
|
||||||
|
if (items == 2)
|
||||||
|
min_status = (uint8)SvUV(ST(1));
|
||||||
|
|
||||||
|
if (items == 3)
|
||||||
|
max_status = (uint8)SvUV(ST(2));
|
||||||
|
|
||||||
|
quest_manager.WorldWideDialogueWindow(message, min_status, max_status);
|
||||||
|
}
|
||||||
|
XSRETURN_EMPTY;
|
||||||
|
}
|
||||||
|
|
||||||
XS(XS__worldwidedisabletask);
|
XS(XS__worldwidedisabletask);
|
||||||
XS(XS__worldwidedisabletask) {
|
XS(XS__worldwidedisabletask) {
|
||||||
dXSARGS;
|
dXSARGS;
|
||||||
@ -7791,6 +7896,12 @@ EXTERN_C XS(boot_quest) {
|
|||||||
newXS(strcpy(buf, "crosszonecastspellbyguildid"), XS__crosszonecastspellbyguildid, file);
|
newXS(strcpy(buf, "crosszonecastspellbyguildid"), XS__crosszonecastspellbyguildid, file);
|
||||||
newXS(strcpy(buf, "crosszonecastspellbyexpeditionid"), XS__crosszonecastspellbyexpeditionid, file);
|
newXS(strcpy(buf, "crosszonecastspellbyexpeditionid"), XS__crosszonecastspellbyexpeditionid, file);
|
||||||
newXS(strcpy(buf, "crosszonecastspellbyclientname"), XS__crosszonecastspellbyclientname, file);
|
newXS(strcpy(buf, "crosszonecastspellbyclientname"), XS__crosszonecastspellbyclientname, file);
|
||||||
|
newXS(strcpy(buf, "crosszonedialoguewindowbycharid"), XS__crosszonedialoguewindowbycharid, file);
|
||||||
|
newXS(strcpy(buf, "crosszonedialoguewindowbygroupid"), XS__crosszonedialoguewindowbygroupid, file);
|
||||||
|
newXS(strcpy(buf, "crosszonedialoguewindowbyraidid"), XS__crosszonedialoguewindowbyraidid, file);
|
||||||
|
newXS(strcpy(buf, "crosszonedialoguewindowbyguildid"), XS__crosszonedialoguewindowbyguildid, file);
|
||||||
|
newXS(strcpy(buf, "crosszonedialoguewindowbyexpeditionid"), XS__crosszonedialoguewindowbyexpeditionid, file);
|
||||||
|
newXS(strcpy(buf, "crosszonedialoguewindowbyclientname"), XS__crosszonedialoguewindowbyclientname, file);
|
||||||
newXS(strcpy(buf, "crosszonedisabletaskbycharid"), XS__crosszonedisabletaskbycharid, file);
|
newXS(strcpy(buf, "crosszonedisabletaskbycharid"), XS__crosszonedisabletaskbycharid, file);
|
||||||
newXS(strcpy(buf, "crosszonedisabletaskbygroupid"), XS__crosszonedisabletaskbygroupid, file);
|
newXS(strcpy(buf, "crosszonedisabletaskbygroupid"), XS__crosszonedisabletaskbygroupid, file);
|
||||||
newXS(strcpy(buf, "crosszonedisabletaskbyraidid"), XS__crosszonedisabletaskbyraidid, file);
|
newXS(strcpy(buf, "crosszonedisabletaskbyraidid"), XS__crosszonedisabletaskbyraidid, file);
|
||||||
@ -7875,6 +7986,7 @@ EXTERN_C XS(boot_quest) {
|
|||||||
newXS(strcpy(buf, "worldwideaddldonpoints"), XS__worldwideaddldonpoints, file);
|
newXS(strcpy(buf, "worldwideaddldonpoints"), XS__worldwideaddldonpoints, file);
|
||||||
newXS(strcpy(buf, "worldwideaddldonwin"), XS__worldwideaddldonwin, file);
|
newXS(strcpy(buf, "worldwideaddldonwin"), XS__worldwideaddldonwin, file);
|
||||||
newXS(strcpy(buf, "worldwidecastspell"), XS__worldwidecastspell, file);
|
newXS(strcpy(buf, "worldwidecastspell"), XS__worldwidecastspell, file);
|
||||||
|
newXS(strcpy(buf, "worldwidedialoguewindow"), XS__worldwidedialoguewindow, file);
|
||||||
newXS(strcpy(buf, "worldwidedisabletask"), XS__worldwidedisabletask, file);
|
newXS(strcpy(buf, "worldwidedisabletask"), XS__worldwidedisabletask, file);
|
||||||
newXS(strcpy(buf, "worldwideenabletask"), XS__worldwideenabletask, file);
|
newXS(strcpy(buf, "worldwideenabletask"), XS__worldwideenabletask, file);
|
||||||
newXS(strcpy(buf, "worldwidefailtask"), XS__worldwidefailtask, file);
|
newXS(strcpy(buf, "worldwidefailtask"), XS__worldwidefailtask, file);
|
||||||
|
|||||||
@ -2179,6 +2179,37 @@ void lua_cross_zone_cast_spell_by_client_name(const char* client_name, uint32 sp
|
|||||||
quest_manager.CrossZoneSpell(update_type, update_subtype, update_identifier, spell_id, client_name);
|
quest_manager.CrossZoneSpell(update_type, update_subtype, update_identifier, spell_id, client_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lua_cross_zone_dialogue_window_by_char_id(int character_id, const char* message) {
|
||||||
|
uint8 update_type = CZUpdateType_Character;
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, character_id, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_cross_zone_dialogue_window_by_group_id(int group_id, const char* message) {
|
||||||
|
uint8 update_type = CZUpdateType_Group;
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, group_id, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_cross_zone_dialogue_window_by_raid_id(int raid_id, const char* message) {
|
||||||
|
uint8 update_type = CZUpdateType_Raid;
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, raid_id, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_cross_zone_dialogue_window_by_guild_id(int guild_id, const char* message) {
|
||||||
|
uint8 update_type = CZUpdateType_Guild;
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, guild_id, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_cross_zone_dialogue_window_by_expedition_id(uint32 expedition_id, const char* message) {
|
||||||
|
uint8 update_type = CZUpdateType_Expedition;
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, expedition_id, message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_cross_zone_dialogue_window_by_client_name(const char* client_name, const char* message) {
|
||||||
|
uint8 update_type = CZUpdateType_ClientName;
|
||||||
|
int update_identifier = 0;
|
||||||
|
quest_manager.CrossZoneDialogueWindow(update_type, update_identifier, message, client_name);
|
||||||
|
}
|
||||||
|
|
||||||
void lua_cross_zone_disable_task_by_char_id(int character_id, uint32 task_id) {
|
void lua_cross_zone_disable_task_by_char_id(int character_id, uint32 task_id) {
|
||||||
uint8 update_type = CZUpdateType_Character;
|
uint8 update_type = CZUpdateType_Character;
|
||||||
uint8 update_subtype = CZTaskUpdateSubtype_DisableTask;
|
uint8 update_subtype = CZTaskUpdateSubtype_DisableTask;
|
||||||
@ -2882,6 +2913,18 @@ void lua_world_wide_cast_spell(uint32 spell_id, uint8 min_status, uint8 max_stat
|
|||||||
quest_manager.WorldWideSpell(update_type, spell_id, min_status, max_status);
|
quest_manager.WorldWideSpell(update_type, spell_id, min_status, max_status);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void lua_world_wide_dialogue_window(const char* message) {
|
||||||
|
quest_manager.WorldWideDialogueWindow(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_world_wide_dialogue_window(const char* message, uint8 min_status) {
|
||||||
|
quest_manager.WorldWideDialogueWindow(message, min_status);
|
||||||
|
}
|
||||||
|
|
||||||
|
void lua_world_wide_dialogue_window(const char* message, uint8 min_status, uint8 max_status) {
|
||||||
|
quest_manager.WorldWideDialogueWindow(message, min_status, max_status);
|
||||||
|
}
|
||||||
|
|
||||||
void lua_world_wide_disable_task(uint32 task_id) {
|
void lua_world_wide_disable_task(uint32 task_id) {
|
||||||
uint8 update_type = WWTaskUpdateType_DisableTask;
|
uint8 update_type = WWTaskUpdateType_DisableTask;
|
||||||
quest_manager.WorldWideTaskUpdate(update_type, task_id);
|
quest_manager.WorldWideTaskUpdate(update_type, task_id);
|
||||||
@ -3662,6 +3705,12 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("cross_zone_cast_spell_by_guild_id", &lua_cross_zone_cast_spell_by_guild_id),
|
luabind::def("cross_zone_cast_spell_by_guild_id", &lua_cross_zone_cast_spell_by_guild_id),
|
||||||
luabind::def("cross_zone_cast_spell_by_expedition_id", &lua_cross_zone_cast_spell_by_expedition_id),
|
luabind::def("cross_zone_cast_spell_by_expedition_id", &lua_cross_zone_cast_spell_by_expedition_id),
|
||||||
luabind::def("cross_zone_cast_spell_by_client_name", &lua_cross_zone_cast_spell_by_client_name),
|
luabind::def("cross_zone_cast_spell_by_client_name", &lua_cross_zone_cast_spell_by_client_name),
|
||||||
|
luabind::def("cross_zone_dialogue_window_by_char_id", &lua_cross_zone_dialogue_window_by_char_id),
|
||||||
|
luabind::def("cross_zone_dialogue_window_by_group_id", &lua_cross_zone_dialogue_window_by_group_id),
|
||||||
|
luabind::def("cross_zone_dialogue_window_by_raid_id", &lua_cross_zone_dialogue_window_by_raid_id),
|
||||||
|
luabind::def("cross_zone_dialogue_window_by_guild_id", &lua_cross_zone_dialogue_window_by_guild_id),
|
||||||
|
luabind::def("cross_zone_dialogue_window_by_expedition_id", &lua_cross_zone_dialogue_window_by_expedition_id),
|
||||||
|
luabind::def("cross_zone_dialogue_window_by_client_name", &lua_cross_zone_dialogue_window_by_client_name),
|
||||||
luabind::def("cross_zone_disable_task_by_char_id", &lua_cross_zone_disable_task_by_char_id),
|
luabind::def("cross_zone_disable_task_by_char_id", &lua_cross_zone_disable_task_by_char_id),
|
||||||
luabind::def("cross_zone_disable_task_by_group_id", &lua_cross_zone_disable_task_by_group_id),
|
luabind::def("cross_zone_disable_task_by_group_id", &lua_cross_zone_disable_task_by_group_id),
|
||||||
luabind::def("cross_zone_disable_task_by_raid_id", &lua_cross_zone_disable_task_by_raid_id),
|
luabind::def("cross_zone_disable_task_by_raid_id", &lua_cross_zone_disable_task_by_raid_id),
|
||||||
@ -3767,6 +3816,9 @@ luabind::scope lua_register_general() {
|
|||||||
luabind::def("world_wide_cast_spell", (void(*)(uint32))&lua_world_wide_cast_spell),
|
luabind::def("world_wide_cast_spell", (void(*)(uint32))&lua_world_wide_cast_spell),
|
||||||
luabind::def("world_wide_cast_spell", (void(*)(uint32,uint8))&lua_world_wide_cast_spell),
|
luabind::def("world_wide_cast_spell", (void(*)(uint32,uint8))&lua_world_wide_cast_spell),
|
||||||
luabind::def("world_wide_cast_spell", (void(*)(uint32,uint8,uint8))&lua_world_wide_cast_spell),
|
luabind::def("world_wide_cast_spell", (void(*)(uint32,uint8,uint8))&lua_world_wide_cast_spell),
|
||||||
|
luabind::def("world_wide_dialogue_window", (void(*)(const char*))&lua_world_wide_dialogue_window),
|
||||||
|
luabind::def("world_wide_dialogue_window", (void(*)(const char*,uint8))&lua_world_wide_dialogue_window),
|
||||||
|
luabind::def("world_wide_dialogue_window", (void(*)(const char*,uint8,uint8))&lua_world_wide_dialogue_window),
|
||||||
luabind::def("world_wide_disable_task", (void(*)(uint32))&lua_world_wide_disable_task),
|
luabind::def("world_wide_disable_task", (void(*)(uint32))&lua_world_wide_disable_task),
|
||||||
luabind::def("world_wide_disable_task", (void(*)(uint32,uint8))&lua_world_wide_disable_task),
|
luabind::def("world_wide_disable_task", (void(*)(uint32,uint8))&lua_world_wide_disable_task),
|
||||||
luabind::def("world_wide_disable_task", (void(*)(uint32,uint8,uint8))&lua_world_wide_disable_task),
|
luabind::def("world_wide_disable_task", (void(*)(uint32,uint8,uint8))&lua_world_wide_disable_task),
|
||||||
|
|||||||
@ -3464,6 +3464,17 @@ int QuestManager::getspellstat(uint32 spell_id, std::string stat_identifier, uin
|
|||||||
return GetSpellStatValue(spell_id, stat_identifier.c_str(), slot);
|
return GetSpellStatValue(spell_id, stat_identifier.c_str(), slot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QuestManager::CrossZoneDialogueWindow(uint8 update_type, int update_identifier, const char* message, const char* client_name) {
|
||||||
|
auto pack = new ServerPacket(ServerOP_CZDialogueWindow, sizeof(CZDialogueWindow_Struct));
|
||||||
|
CZDialogueWindow_Struct* CZDW = (CZDialogueWindow_Struct*)pack->pBuffer;
|
||||||
|
CZDW->update_type = update_type;
|
||||||
|
CZDW->update_identifier = update_identifier;
|
||||||
|
strn0cpy(CZDW->message, message, 4096);
|
||||||
|
strn0cpy(CZDW->client_name, client_name, 64);
|
||||||
|
worldserver.SendPacket(pack);
|
||||||
|
safe_delete(pack);
|
||||||
|
}
|
||||||
|
|
||||||
void QuestManager::CrossZoneLDoNUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 theme_id, int points, const char* client_name) {
|
void QuestManager::CrossZoneLDoNUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 theme_id, int points, const char* client_name) {
|
||||||
auto pack = new ServerPacket(ServerOP_CZLDoNUpdate, sizeof(CZLDoNUpdate_Struct));
|
auto pack = new ServerPacket(ServerOP_CZLDoNUpdate, sizeof(CZLDoNUpdate_Struct));
|
||||||
CZLDoNUpdate_Struct* CZLU = (CZLDoNUpdate_Struct*)pack->pBuffer;
|
CZLDoNUpdate_Struct* CZLU = (CZLDoNUpdate_Struct*)pack->pBuffer;
|
||||||
@ -3568,6 +3579,16 @@ void QuestManager::CrossZoneTaskUpdate(uint8 update_type, uint8 update_subtype,
|
|||||||
safe_delete(pack);
|
safe_delete(pack);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QuestManager::WorldWideDialogueWindow(const char* message, uint8 min_status, uint8 max_status) {
|
||||||
|
auto pack = new ServerPacket(ServerOP_WWDialogueWindow, sizeof(WWDialogueWindow_Struct));
|
||||||
|
WWDialogueWindow_Struct* WWDW = (WWDialogueWindow_Struct*)pack->pBuffer;
|
||||||
|
strn0cpy(WWDW->message, message, 4096);
|
||||||
|
WWDW->min_status = min_status;
|
||||||
|
WWDW->max_status = max_status;
|
||||||
|
worldserver.SendPacket(pack);
|
||||||
|
safe_delete(pack);
|
||||||
|
}
|
||||||
|
|
||||||
void QuestManager::WorldWideLDoNUpdate(uint8 update_type, uint32 theme_id, int points, uint8 min_status, uint8 max_status) {
|
void QuestManager::WorldWideLDoNUpdate(uint8 update_type, uint32 theme_id, int points, uint8 min_status, uint8 max_status) {
|
||||||
auto pack = new ServerPacket(ServerOP_WWLDoNUpdate, sizeof(WWLDoNUpdate_Struct));
|
auto pack = new ServerPacket(ServerOP_WWLDoNUpdate, sizeof(WWLDoNUpdate_Struct));
|
||||||
WWLDoNUpdate_Struct* WWLU = (WWLDoNUpdate_Struct*)pack->pBuffer;
|
WWLDoNUpdate_Struct* WWLU = (WWLDoNUpdate_Struct*)pack->pBuffer;
|
||||||
|
|||||||
@ -290,6 +290,7 @@ public:
|
|||||||
static std::string GetZoneLongName(std::string zone_short_name);
|
static std::string GetZoneLongName(std::string zone_short_name);
|
||||||
static std::string GetZoneLongNameByID(uint32 zone_id);
|
static std::string GetZoneLongNameByID(uint32 zone_id);
|
||||||
static std::string GetZoneShortName(uint32 zone_id);
|
static std::string GetZoneShortName(uint32 zone_id);
|
||||||
|
void CrossZoneDialogueWindow(uint8 update_type, int update_identifier, const char* message, const char* client_name = "");
|
||||||
void CrossZoneLDoNUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 theme_id, int points = 1, const char* client_name = "");
|
void CrossZoneLDoNUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 theme_id, int points = 1, const char* client_name = "");
|
||||||
void CrossZoneMarquee(uint8 update_type, int update_identifier, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, const char* message, const char* client_name = "");
|
void CrossZoneMarquee(uint8 update_type, int update_identifier, uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, const char* message, const char* client_name = "");
|
||||||
void CrossZoneMessage(uint8 update_type, int update_identifier, uint32 type, const char* message, const char* client_name = "");
|
void CrossZoneMessage(uint8 update_type, int update_identifier, uint32 type, const char* message, const char* client_name = "");
|
||||||
@ -298,6 +299,7 @@ public:
|
|||||||
void CrossZoneSignal(uint8 update_type, int update_identifier, uint32 signal, const char* client_name = "");
|
void CrossZoneSignal(uint8 update_type, int update_identifier, uint32 signal, const char* client_name = "");
|
||||||
void CrossZoneSpell(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 spell_id, const char* client_name = "");
|
void CrossZoneSpell(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 spell_id, const char* client_name = "");
|
||||||
void CrossZoneTaskUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 task_identifier, int task_subidentifier = -1, int update_count = 1, bool enforce_level_requirement = false, const char* client_name = "");
|
void CrossZoneTaskUpdate(uint8 update_type, uint8 update_subtype, int update_identifier, uint32 task_identifier, int task_subidentifier = -1, int update_count = 1, bool enforce_level_requirement = false, const char* client_name = "");
|
||||||
|
void WorldWideDialogueWindow(const char* message, uint8 min_status = 0, uint8 max_status = 0);
|
||||||
void WorldWideLDoNUpdate(uint8 update_type, uint32 theme_id, int points = 1, uint8 min_status = 0, uint8 max_status = 0);
|
void WorldWideLDoNUpdate(uint8 update_type, uint32 theme_id, int points = 1, uint8 min_status = 0, uint8 max_status = 0);
|
||||||
void WorldWideMarquee(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, const char* message, uint8 min_status = 0, uint8 max_status = 0);
|
void WorldWideMarquee(uint32 type, uint32 priority, uint32 fade_in, uint32 fade_out, uint32 duration, const char* message, uint8 min_status = 0, uint8 max_status = 0);
|
||||||
void WorldWideMessage(uint32 type, const char* message, uint8 min_status = 0, uint8 max_status = 0);
|
void WorldWideMessage(uint32 type, const char* message, uint8 min_status = 0, uint8 max_status = 0);
|
||||||
|
|||||||
@ -56,6 +56,7 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
|||||||
#include "zone_reload.h"
|
#include "zone_reload.h"
|
||||||
#include "../common/shared_tasks.h"
|
#include "../common/shared_tasks.h"
|
||||||
#include "shared_task_zone_messaging.h"
|
#include "shared_task_zone_messaging.h"
|
||||||
|
#include "dialogue_window.h"
|
||||||
|
|
||||||
extern EntityList entity_list;
|
extern EntityList entity_list;
|
||||||
extern Zone* zone;
|
extern Zone* zone;
|
||||||
@ -1887,25 +1888,17 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ServerOP_CZSpell:
|
case ServerOP_CZDialogueWindow:
|
||||||
{
|
{
|
||||||
CZSpell_Struct* CZS = (CZSpell_Struct*) pack->pBuffer;
|
CZDialogueWindow_Struct* CZDW = (CZDialogueWindow_Struct*) pack->pBuffer;
|
||||||
uint8 update_type = CZS->update_type;
|
uint8 update_type = CZDW->update_type;
|
||||||
uint8 update_subtype = CZS->update_subtype;
|
int update_identifier = CZDW->update_identifier;
|
||||||
int update_identifier = CZS->update_identifier;
|
std::string message = CZDW->message;
|
||||||
uint32 spell_id = CZS->spell_id;
|
const char* client_name = CZDW->client_name;
|
||||||
const char* client_name = CZS->client_name;
|
|
||||||
if (update_type == CZUpdateType_Character) {
|
if (update_type == CZUpdateType_Character) {
|
||||||
auto client = entity_list.GetClientByCharID(update_identifier);
|
auto client = entity_list.GetClientByCharID(update_identifier);
|
||||||
if (client) {
|
if (client) {
|
||||||
switch (update_subtype) {
|
DialogueWindow::Render(client, message);
|
||||||
case CZSpellUpdateSubtype_Cast:
|
|
||||||
client->SpellFinished(spell_id, client);
|
|
||||||
break;
|
|
||||||
case CZSpellUpdateSubtype_Remove:
|
|
||||||
client->BuffFadeBySpellID(spell_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else if (update_type == CZUpdateType_Group) {
|
} else if (update_type == CZUpdateType_Group) {
|
||||||
auto client_group = entity_list.GetGroupByID(update_identifier);
|
auto client_group = entity_list.GetGroupByID(update_identifier);
|
||||||
@ -1913,14 +1906,7 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
for (int member_index = 0; member_index < MAX_GROUP_MEMBERS; member_index++) {
|
for (int member_index = 0; member_index < MAX_GROUP_MEMBERS; member_index++) {
|
||||||
if (client_group->members[member_index] && client_group->members[member_index]->IsClient()) {
|
if (client_group->members[member_index] && client_group->members[member_index]->IsClient()) {
|
||||||
auto group_member = client_group->members[member_index]->CastToClient();
|
auto group_member = client_group->members[member_index]->CastToClient();
|
||||||
switch (update_subtype) {
|
DialogueWindow::Render(group_member, message);
|
||||||
case CZSpellUpdateSubtype_Cast:
|
|
||||||
group_member->SpellFinished(spell_id, group_member);
|
|
||||||
break;
|
|
||||||
case CZSpellUpdateSubtype_Remove:
|
|
||||||
group_member->BuffFadeBySpellID(spell_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1930,243 +1916,26 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
for (int member_index = 0; member_index < MAX_RAID_MEMBERS; member_index++) {
|
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()) {
|
if (client_raid->members[member_index].member && client_raid->members[member_index].member->IsClient()) {
|
||||||
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
auto raid_member = client_raid->members[member_index].member->CastToClient();
|
||||||
switch (update_subtype) {
|
DialogueWindow::Render(raid_member, message);
|
||||||
case CZSpellUpdateSubtype_Cast:
|
|
||||||
raid_member->SpellFinished(spell_id, raid_member);
|
|
||||||
break;
|
|
||||||
case CZSpellUpdateSubtype_Remove:
|
|
||||||
raid_member->BuffFadeBySpellID(spell_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (update_type == CZUpdateType_Guild) {
|
} else if (update_type == CZUpdateType_Guild) {
|
||||||
for (auto &client: entity_list.GetClientList()) {
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
if (client.second->GuildID() > 0 && client.second->GuildID() == update_identifier) {
|
if (client.second->GuildID() > 0 && client.second->GuildID() == update_identifier) {
|
||||||
switch (update_subtype) {
|
DialogueWindow::Render(client.second, message);
|
||||||
case CZSpellUpdateSubtype_Cast:
|
|
||||||
client.second->SpellFinished(spell_id, client.second);
|
|
||||||
break;
|
|
||||||
case CZSpellUpdateSubtype_Remove:
|
|
||||||
client.second->BuffFadeBySpellID(spell_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (update_type == CZUpdateType_Expedition) {
|
} else if (update_type == CZUpdateType_Expedition) {
|
||||||
for (auto &client: entity_list.GetClientList()) {
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
if (client.second->GetExpedition() && client.second->GetExpedition()->GetID() == update_identifier) {
|
if (client.second->GetExpedition() && client.second->GetExpedition()->GetID() == update_identifier) {
|
||||||
switch (update_subtype) {
|
DialogueWindow::Render(client.second, message);
|
||||||
case CZSpellUpdateSubtype_Cast:
|
|
||||||
client.second->SpellFinished(spell_id, client.second);
|
|
||||||
break;
|
|
||||||
case CZSpellUpdateSubtype_Remove:
|
|
||||||
client.second->BuffFadeBySpellID(spell_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (update_type == CZUpdateType_ClientName) {
|
} else if (update_type == CZUpdateType_ClientName) {
|
||||||
auto client = entity_list.GetClientByName(client_name);
|
auto client = entity_list.GetClientByName(client_name);
|
||||||
if (client) {
|
if (client) {
|
||||||
switch (update_subtype) {
|
DialogueWindow::Render(client, message);
|
||||||
case CZSpellUpdateSubtype_Cast:
|
|
||||||
client->SpellFinished(spell_id, client);
|
|
||||||
break;
|
|
||||||
case CZSpellUpdateSubtype_Remove:
|
|
||||||
client->BuffFadeBySpellID(spell_id);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
case ServerOP_CZTaskUpdate:
|
|
||||||
{
|
|
||||||
CZTaskUpdate_Struct* CZTU = (CZTaskUpdate_Struct*) pack->pBuffer;
|
|
||||||
uint8 update_type = CZTU->update_type;
|
|
||||||
uint8 update_subtype = CZTU->update_subtype;
|
|
||||||
int update_identifier = CZTU->update_identifier;
|
|
||||||
uint32 task_identifier = CZTU->task_identifier;
|
|
||||||
int task_subidentifier = CZTU->task_subidentifier;
|
|
||||||
int update_count = CZTU->update_count;
|
|
||||||
bool enforce_level_requirement = CZTU->enforce_level_requirement;
|
|
||||||
const char* client_name = CZTU->client_name;
|
|
||||||
if (update_type == CZUpdateType_Character) {
|
|
||||||
auto client = entity_list.GetClientByCharID(update_identifier);
|
|
||||||
if (client) {
|
|
||||||
switch (update_subtype) {
|
|
||||||
case CZTaskUpdateSubtype_ActivityReset:
|
|
||||||
client->ResetTaskActivity(task_identifier, task_subidentifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_ActivityUpdate:
|
|
||||||
client->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_AssignTask:
|
|
||||||
client->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_DisableTask:
|
|
||||||
client->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_EnableTask:
|
|
||||||
client->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_FailTask:
|
|
||||||
client->FailTask(task_identifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_RemoveTask:
|
|
||||||
client->RemoveTaskByTaskID(task_identifier);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
} else if (update_type == CZUpdateType_Group) {
|
|
||||||
auto client_group = entity_list.GetGroupByID(update_identifier);
|
|
||||||
if (client_group) {
|
|
||||||
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();
|
|
||||||
switch (update_subtype) {
|
|
||||||
case CZTaskUpdateSubtype_ActivityReset:
|
|
||||||
group_member->ResetTaskActivity(task_identifier, task_subidentifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_ActivityUpdate:
|
|
||||||
group_member->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_AssignTask:
|
|
||||||
group_member->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_DisableTask:
|
|
||||||
group_member->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_EnableTask:
|
|
||||||
group_member->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_FailTask:
|
|
||||||
group_member->FailTask(task_identifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_RemoveTask:
|
|
||||||
group_member->RemoveTaskByTaskID(task_identifier);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (update_type == CZUpdateType_Raid) {
|
|
||||||
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
|
||||||
if (client_raid) {
|
|
||||||
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();
|
|
||||||
switch (update_subtype) {
|
|
||||||
case CZTaskUpdateSubtype_ActivityReset:
|
|
||||||
raid_member->ResetTaskActivity(task_identifier, task_subidentifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_ActivityUpdate:
|
|
||||||
raid_member->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_AssignTask:
|
|
||||||
raid_member->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_DisableTask:
|
|
||||||
raid_member->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_EnableTask:
|
|
||||||
raid_member->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_FailTask:
|
|
||||||
raid_member->FailTask(task_identifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_RemoveTask:
|
|
||||||
raid_member->RemoveTaskByTaskID(task_identifier);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (update_type == CZUpdateType_Guild) {
|
|
||||||
for (auto &client: entity_list.GetClientList()) {
|
|
||||||
if (client.second->GuildID() > 0 && client.second->GuildID() == update_identifier) {
|
|
||||||
switch (update_subtype) {
|
|
||||||
case CZTaskUpdateSubtype_ActivityReset:
|
|
||||||
client.second->ResetTaskActivity(task_identifier, task_subidentifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_ActivityUpdate:
|
|
||||||
client.second->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_AssignTask:
|
|
||||||
client.second->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_DisableTask:
|
|
||||||
client.second->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_EnableTask:
|
|
||||||
client.second->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_FailTask:
|
|
||||||
client.second->FailTask(task_identifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_RemoveTask:
|
|
||||||
client.second->RemoveTaskByTaskID(task_identifier);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (update_type == CZUpdateType_Expedition) {
|
|
||||||
for (auto &client: entity_list.GetClientList()) {
|
|
||||||
if (client.second->GetExpedition() && client.second->GetExpedition()->GetID() == update_identifier) {
|
|
||||||
switch (update_subtype) {
|
|
||||||
case CZTaskUpdateSubtype_ActivityReset:
|
|
||||||
client.second->ResetTaskActivity(task_identifier, task_subidentifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_ActivityUpdate:
|
|
||||||
client.second->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_AssignTask:
|
|
||||||
client.second->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_DisableTask:
|
|
||||||
client.second->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_EnableTask:
|
|
||||||
client.second->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_FailTask:
|
|
||||||
client.second->FailTask(task_identifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_RemoveTask:
|
|
||||||
client.second->RemoveTaskByTaskID(task_identifier);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} else if (update_type == CZUpdateType_ClientName) {
|
|
||||||
auto client = entity_list.GetClientByName(client_name);
|
|
||||||
if (client) {
|
|
||||||
switch (update_subtype) {
|
|
||||||
case CZTaskUpdateSubtype_ActivityReset:
|
|
||||||
client->ResetTaskActivity(task_identifier, task_subidentifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_ActivityUpdate:
|
|
||||||
client->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_AssignTask:
|
|
||||||
client->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_DisableTask:
|
|
||||||
client->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_EnableTask:
|
|
||||||
client->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_FailTask:
|
|
||||||
client->FailTask(task_identifier);
|
|
||||||
break;
|
|
||||||
case CZTaskUpdateSubtype_RemoveTask:
|
|
||||||
client->RemoveTaskByTaskID(task_identifier);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -2620,6 +2389,303 @@ void WorldServer::HandleMessage(uint16 opcode, const EQ::Net::Packet &p)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case ServerOP_CZSpell:
|
||||||
|
{
|
||||||
|
CZSpell_Struct* CZS = (CZSpell_Struct*) pack->pBuffer;
|
||||||
|
uint8 update_type = CZS->update_type;
|
||||||
|
uint8 update_subtype = CZS->update_subtype;
|
||||||
|
int update_identifier = CZS->update_identifier;
|
||||||
|
uint32 spell_id = CZS->spell_id;
|
||||||
|
const char* client_name = CZS->client_name;
|
||||||
|
if (update_type == CZUpdateType_Character) {
|
||||||
|
auto client = entity_list.GetClientByCharID(update_identifier);
|
||||||
|
if (client) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZSpellUpdateSubtype_Cast:
|
||||||
|
client->SpellFinished(spell_id, client);
|
||||||
|
break;
|
||||||
|
case CZSpellUpdateSubtype_Remove:
|
||||||
|
client->BuffFadeBySpellID(spell_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Group) {
|
||||||
|
auto client_group = entity_list.GetGroupByID(update_identifier);
|
||||||
|
if (client_group) {
|
||||||
|
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();
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZSpellUpdateSubtype_Cast:
|
||||||
|
group_member->SpellFinished(spell_id, group_member);
|
||||||
|
break;
|
||||||
|
case CZSpellUpdateSubtype_Remove:
|
||||||
|
group_member->BuffFadeBySpellID(spell_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Raid) {
|
||||||
|
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||||
|
if (client_raid) {
|
||||||
|
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();
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZSpellUpdateSubtype_Cast:
|
||||||
|
raid_member->SpellFinished(spell_id, raid_member);
|
||||||
|
break;
|
||||||
|
case CZSpellUpdateSubtype_Remove:
|
||||||
|
raid_member->BuffFadeBySpellID(spell_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Guild) {
|
||||||
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
|
if (client.second->GuildID() > 0 && client.second->GuildID() == update_identifier) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZSpellUpdateSubtype_Cast:
|
||||||
|
client.second->SpellFinished(spell_id, client.second);
|
||||||
|
break;
|
||||||
|
case CZSpellUpdateSubtype_Remove:
|
||||||
|
client.second->BuffFadeBySpellID(spell_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Expedition) {
|
||||||
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
|
if (client.second->GetExpedition() && client.second->GetExpedition()->GetID() == update_identifier) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZSpellUpdateSubtype_Cast:
|
||||||
|
client.second->SpellFinished(spell_id, client.second);
|
||||||
|
break;
|
||||||
|
case CZSpellUpdateSubtype_Remove:
|
||||||
|
client.second->BuffFadeBySpellID(spell_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_ClientName) {
|
||||||
|
auto client = entity_list.GetClientByName(client_name);
|
||||||
|
if (client) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZSpellUpdateSubtype_Cast:
|
||||||
|
client->SpellFinished(spell_id, client);
|
||||||
|
break;
|
||||||
|
case CZSpellUpdateSubtype_Remove:
|
||||||
|
client->BuffFadeBySpellID(spell_id);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ServerOP_CZTaskUpdate:
|
||||||
|
{
|
||||||
|
CZTaskUpdate_Struct* CZTU = (CZTaskUpdate_Struct*) pack->pBuffer;
|
||||||
|
uint8 update_type = CZTU->update_type;
|
||||||
|
uint8 update_subtype = CZTU->update_subtype;
|
||||||
|
int update_identifier = CZTU->update_identifier;
|
||||||
|
uint32 task_identifier = CZTU->task_identifier;
|
||||||
|
int task_subidentifier = CZTU->task_subidentifier;
|
||||||
|
int update_count = CZTU->update_count;
|
||||||
|
bool enforce_level_requirement = CZTU->enforce_level_requirement;
|
||||||
|
const char* client_name = CZTU->client_name;
|
||||||
|
if (update_type == CZUpdateType_Character) {
|
||||||
|
auto client = entity_list.GetClientByCharID(update_identifier);
|
||||||
|
if (client) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZTaskUpdateSubtype_ActivityReset:
|
||||||
|
client->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_ActivityUpdate:
|
||||||
|
client->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_AssignTask:
|
||||||
|
client->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_DisableTask:
|
||||||
|
client->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_EnableTask:
|
||||||
|
client->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_FailTask:
|
||||||
|
client->FailTask(task_identifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_RemoveTask:
|
||||||
|
client->RemoveTaskByTaskID(task_identifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
} else if (update_type == CZUpdateType_Group) {
|
||||||
|
auto client_group = entity_list.GetGroupByID(update_identifier);
|
||||||
|
if (client_group) {
|
||||||
|
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();
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZTaskUpdateSubtype_ActivityReset:
|
||||||
|
group_member->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_ActivityUpdate:
|
||||||
|
group_member->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_AssignTask:
|
||||||
|
group_member->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_DisableTask:
|
||||||
|
group_member->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_EnableTask:
|
||||||
|
group_member->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_FailTask:
|
||||||
|
group_member->FailTask(task_identifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_RemoveTask:
|
||||||
|
group_member->RemoveTaskByTaskID(task_identifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Raid) {
|
||||||
|
auto client_raid = entity_list.GetRaidByID(update_identifier);
|
||||||
|
if (client_raid) {
|
||||||
|
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();
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZTaskUpdateSubtype_ActivityReset:
|
||||||
|
raid_member->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_ActivityUpdate:
|
||||||
|
raid_member->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_AssignTask:
|
||||||
|
raid_member->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_DisableTask:
|
||||||
|
raid_member->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_EnableTask:
|
||||||
|
raid_member->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_FailTask:
|
||||||
|
raid_member->FailTask(task_identifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_RemoveTask:
|
||||||
|
raid_member->RemoveTaskByTaskID(task_identifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Guild) {
|
||||||
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
|
if (client.second->GuildID() > 0 && client.second->GuildID() == update_identifier) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZTaskUpdateSubtype_ActivityReset:
|
||||||
|
client.second->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_ActivityUpdate:
|
||||||
|
client.second->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_AssignTask:
|
||||||
|
client.second->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_DisableTask:
|
||||||
|
client.second->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_EnableTask:
|
||||||
|
client.second->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_FailTask:
|
||||||
|
client.second->FailTask(task_identifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_RemoveTask:
|
||||||
|
client.second->RemoveTaskByTaskID(task_identifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_Expedition) {
|
||||||
|
for (auto &client: entity_list.GetClientList()) {
|
||||||
|
if (client.second->GetExpedition() && client.second->GetExpedition()->GetID() == update_identifier) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZTaskUpdateSubtype_ActivityReset:
|
||||||
|
client.second->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_ActivityUpdate:
|
||||||
|
client.second->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_AssignTask:
|
||||||
|
client.second->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_DisableTask:
|
||||||
|
client.second->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_EnableTask:
|
||||||
|
client.second->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_FailTask:
|
||||||
|
client.second->FailTask(task_identifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_RemoveTask:
|
||||||
|
client.second->RemoveTaskByTaskID(task_identifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else if (update_type == CZUpdateType_ClientName) {
|
||||||
|
auto client = entity_list.GetClientByName(client_name);
|
||||||
|
if (client) {
|
||||||
|
switch (update_subtype) {
|
||||||
|
case CZTaskUpdateSubtype_ActivityReset:
|
||||||
|
client->ResetTaskActivity(task_identifier, task_subidentifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_ActivityUpdate:
|
||||||
|
client->UpdateTaskActivity(task_identifier, task_subidentifier, update_count);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_AssignTask:
|
||||||
|
client->AssignTask(task_identifier, task_subidentifier, enforce_level_requirement);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_DisableTask:
|
||||||
|
client->DisableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_EnableTask:
|
||||||
|
client->EnableTask(1, reinterpret_cast<int *>(task_identifier));
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_FailTask:
|
||||||
|
client->FailTask(task_identifier);
|
||||||
|
break;
|
||||||
|
case CZTaskUpdateSubtype_RemoveTask:
|
||||||
|
client->RemoveTaskByTaskID(task_identifier);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
case ServerOP_WWDialogueWindow:
|
||||||
|
{
|
||||||
|
WWDialogueWindow_Struct* WWDW = (WWDialogueWindow_Struct*) pack->pBuffer;
|
||||||
|
std::string message = WWDW->message;
|
||||||
|
uint8 min_status = WWDW->min_status;
|
||||||
|
uint8 max_status = WWDW->max_status;
|
||||||
|
for (auto &client : entity_list.GetClientList()) {
|
||||||
|
if (client.second->Admin() >= min_status && (client.second->Admin() <= max_status || max_status == 0)) {
|
||||||
|
DialogueWindow::Render(client.second, message);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
case ServerOP_WWLDoNUpdate:
|
case ServerOP_WWLDoNUpdate:
|
||||||
{
|
{
|
||||||
WWLDoNUpdate_Struct* WWLU = (WWLDoNUpdate_Struct*) pack->pBuffer;
|
WWLDoNUpdate_Struct* WWLU = (WWLDoNUpdate_Struct*) pack->pBuffer;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user