mirror of
https://github.com/EQEmu/Server.git
synced 2026-09-05 23:56:35 +00:00
Dungeon Crawl custom code merge
Added numerous modding hooks. Added rules: Character:KeepLevelOverMax - Don't delevel a character if they are found to be over max level rule. Spells:UseCHAScribeHack - Optionally omit spells with CHA in effect12 when using scribespells and traindiscs Combat:MonkACBonusWeight - Adjust the weight threshold for monk AC bonus Combat:ClientStunLevel - Adjust the level clients kicks and bashes start to roll for stuns Combat;QuiverWRHasteDiv - Adjust the divisor applied to weight reduction for haste calcs Combat:UseArcheryBonusRoll - Make archery stationary bonus a roll Combat:ArcheryBonusChance - Archery stationary bonus chance Added account flags and associated perl wrappers Added EVENT_ITEM_TICK for interactive items Added EVENT_DUEL_WIN and EVENT_DUEL_LOSE, which exports $enemyname and $enemyid Added timer and interval to console worldshutdown command Added EQW interface for worldshutdown and server-wide messages
This commit is contained in:
@@ -459,6 +459,14 @@ void EQW::ResolveBug(const char *id) {
|
||||
safe_delete_array(query);
|
||||
}
|
||||
|
||||
//DCBOOKMARK
|
||||
void EQW::SendMessage(uint32 type, const char *msg) {
|
||||
zoneserver_list.SendEmoteMessage(0, 0, 0, type, msg);
|
||||
}
|
||||
|
||||
void EQW::WorldShutDown(uint32 time, uint32 interval) {
|
||||
zoneserver_list.WorldShutDown(time, interval);
|
||||
}
|
||||
|
||||
#endif //EMBPERL
|
||||
|
||||
|
||||
@@ -78,6 +78,8 @@ public:
|
||||
map<string,string> GetBugDetails(const char *id);
|
||||
void ResolveBug(const char *id);
|
||||
|
||||
void SendMessage(uint32 type, const char *msg);
|
||||
void WorldShutDown(uint32 time, uint32 interval);
|
||||
//END PERL EXPORT
|
||||
|
||||
protected:
|
||||
|
||||
+18
-5
@@ -722,11 +722,24 @@ void Console::ProcessCommand(const char* command) {
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(sep.arg[0], "worldshutdown") == 0 && admin >= consoleWorldStatus) {
|
||||
ServerPacket* pack = new ServerPacket(ServerOP_ShutdownAll);
|
||||
zoneserver_list.SendPacket(pack);
|
||||
delete pack;
|
||||
SendMessage(1, "Sending shutdown packet... goodbye.");
|
||||
CatchSignal(0);
|
||||
int32 time, interval;
|
||||
if(sep.IsNumber(1) && sep.IsNumber(2) && ((time=atoi(sep.arg[1]))>0) && ((interval=atoi(sep.arg[2]))>0)) {
|
||||
zoneserver_list.WorldShutDown(time, interval);
|
||||
}
|
||||
else if(strcasecmp(sep.arg[1], "now") == 0) {
|
||||
zoneserver_list.WorldShutDown(0, 0);
|
||||
}
|
||||
else if(strcasecmp(sep.arg[1], "disable") == 0) {
|
||||
SendEmoteMessage(0,0,0,15,"<SYSTEMWIDE MESSAGE>:SYSTEM MSG:World shutdown aborted.");
|
||||
zoneserver_list.SendEmoteMessage(0,0,0,15,"<SYSTEMWIDE MESSAGE>:SYSTEM MSG:World shutdown aborted.");
|
||||
zoneserver_list.shutdowntimer->Disable();
|
||||
zoneserver_list.reminder->Disable();
|
||||
}
|
||||
else {
|
||||
SendMessage(1, "Usage: worldshutdown [now] [disable] ([time] [interval])");
|
||||
//Go ahead and shut down since that's what this used to do when invoked this way.
|
||||
zoneserver_list.WorldShutDown(0, 0);
|
||||
}
|
||||
}
|
||||
else if (strcasecmp(sep.arg[0], "lock") == 0 && admin >= consoleLockStatus) {
|
||||
WorldConfig::LockWorld();
|
||||
|
||||
@@ -969,6 +969,57 @@ XS(XS_EQW_ResolveBug)
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_EQW_SendMessage); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_EQW_SendMessage)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 3)
|
||||
Perl_croak(aTHX_ "Usage: EQW::SendMessage(THIS, type, message)");
|
||||
{
|
||||
EQW * THIS;
|
||||
dXSTARG;
|
||||
uint32 msgtype = (uint32)SvUV(ST(1));
|
||||
char* msg = (char *)SvPV_nolen(ST(2));
|
||||
|
||||
if (sv_derived_from(ST(0), "EQW")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(EQW *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type EQW");
|
||||
if(THIS == NULL)
|
||||
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
|
||||
|
||||
THIS->SendMessage(msgtype, msg);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
XS(XS_EQW_WorldShutDown); /* prototype to pass -Wmissing-prototypes */
|
||||
XS(XS_EQW_WorldShutDown)
|
||||
{
|
||||
dXSARGS;
|
||||
if (items != 3)
|
||||
Perl_croak(aTHX_ "Usage: EQW::WorldShutDown(THIS, time, interval)");
|
||||
{
|
||||
EQW * THIS;
|
||||
dXSTARG;
|
||||
uint32 time = (uint32)SvUV(ST(1));
|
||||
uint32 interval = (uint32)SvUV(ST(2));
|
||||
|
||||
if (sv_derived_from(ST(0), "EQW")) {
|
||||
IV tmp = SvIV((SV*)SvRV(ST(0)));
|
||||
THIS = INT2PTR(EQW *,tmp);
|
||||
}
|
||||
else
|
||||
Perl_croak(aTHX_ "THIS is not of type EQW");
|
||||
if(THIS == NULL)
|
||||
Perl_croak(aTHX_ "THIS is NULL, avoiding crash.");
|
||||
|
||||
THIS->WorldShutDown(time, interval);
|
||||
}
|
||||
XSRETURN_EMPTY;
|
||||
}
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
@@ -1020,6 +1071,8 @@ XS(boot_EQW)
|
||||
newXSproto(strcpy(buf, "ListBugs"), XS_EQW_ListBugs, file, "$$");
|
||||
newXSproto(strcpy(buf, "GetBugDetails"), XS_EQW_GetBugDetails, file, "$$");
|
||||
newXSproto(strcpy(buf, "ResolveBug"), XS_EQW_ResolveBug, file, "$$");
|
||||
newXSproto(strcpy(buf, "SendMessage"), XS_EQW_SendMessage, file, "$$$");
|
||||
newXSproto(strcpy(buf, "WorldShutDown"), XS_EQW_WorldShutDown, file, "$$$");
|
||||
XSRETURN_YES;
|
||||
}
|
||||
|
||||
|
||||
+25
-9
@@ -716,14 +716,30 @@ void ZSList::GetZoneIDList(vector<uint32> &zones) {
|
||||
|
||||
}
|
||||
|
||||
//DCBOOKMARK
|
||||
void ZSList::WorldShutDown(uint32 time, uint32 interval)
|
||||
{
|
||||
if( time > 0 ) {
|
||||
SendEmoteMessage(0,0,0,15,"<SYSTEMWIDE MESSAGE>:SYSTEM MSG:World coming down in %i seconds, everyone log out before this time.",time);
|
||||
|
||||
time *= 1000;
|
||||
interval *= 1000;
|
||||
if(interval < 5000) { interval = 5000; }
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
shutdowntimer->SetTimer(time);
|
||||
reminder->SetTimer(interval-1000);
|
||||
reminder->SetAtTrigger(interval);
|
||||
shutdowntimer->Start();
|
||||
reminder->Start();
|
||||
}
|
||||
else {
|
||||
SendEmoteMessage(0,0,0,15,"<SYSTEMWIDE MESSAGE>:SYSTEM MSG:World coming down, everyone log out now.");
|
||||
ServerPacket* pack = new ServerPacket;
|
||||
pack->opcode = ServerOP_ShutdownAll;
|
||||
pack->size=0;
|
||||
SendPacket(pack);
|
||||
safe_delete(pack);
|
||||
Process();
|
||||
CatchSignal(2);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -56,7 +56,8 @@ public:
|
||||
|
||||
int GetZoneCount();
|
||||
void GetZoneIDList(std::vector<uint32> &zones);
|
||||
|
||||
void WorldShutDown(uint32 time, uint32 interval);
|
||||
|
||||
protected:
|
||||
uint32 NextID;
|
||||
LinkedList<ZoneServer*> list;
|
||||
|
||||
Reference in New Issue
Block a user