// TMW-2 Script. // Author: // Saulc // Jesusalva // Notes: // Tulim banker, and also handles PCLogin events: CheckClientVersion, and bank // Take care of server updates, but instances are defined on their ships. 033-4,35,31,0 script Malindou NPC_LLOYD,{ Banker(.name$, "Porthos", 50); close; OnInit: .sex = G_MALE; .distance = 4; // Update handler (use `date +%s` for this) // Current UPDATE value: Qui Jun 7 08:10:55 -03 2018 if ($UPDATE < 1528369855) { $UPDATE=1528369855; debugmes "Warning."; debugmes "Warning."; debugmes "Warning: This introduces a server update:"; debugmes ""; debugmes "* Automatic variable setup"; debugmes ""; $BCONFN_SPAWN = 70; $BCONFD_SPAWN = 100; $BCONFN_MOBHP = 100; $BCONFD_MOBHP = 90; $BCONFB_EXPR = 100; $BCONFN_EXPR = 5; $BCONFD_EXPR = 0; $BCONFB_DROP = 100; $BCONFN_DROP = 7; $BCONFD_DROP = 0; $BETASERVER = false; $AUTORESTART = false; $ALLIANCE_TAX1 = 7500; $ALLIANCE_TAX2 = 60; } /* // Current UPDATE value: Ter Jul 28 22:49:52 BRT 2020 // Tulimshar Volcano if ($UPDATE < 1595987392) { $UPDATE=1595987392; ReplaceItemFromEveryPlayer(816, IcedBottle); debugmes ""; debugmes "* Iced Water re-id"; debugmes ""; } // Current UPDATE value: Ter Mar 9 18:45:00 BRT 2021 // Easter Upgrade if ($UPDATE < 1615326300) { $UPDATE=1615326300; DelChrRegFromEveryPlayer("EASTER_EVENT"); debugmes ""; debugmes "* Easter changes"; debugmes ""; } // Current UPDATE value: Qui Set 23 18:46:36 BRT 2021 // Variable Update if ($UPDATE < 1632433596) { $UPDATE=1632433596; $ALLIANCE_TAX1 = 7500; $ALLIANCE_TAX2 = 60; debugmes ""; debugmes "* New global variables"; debugmes ""; } */ end; OnClock0500: if (gettime(GETTIME_DAYOFMONTH) >= 7) query_sql("DELETE FROM `chatlog` WHERE `time` < '"+sqldate(-7)+"'"); query_sql("DELETE FROM `picklog` WHERE `time` < '"+sqldate(0, -3)+"'"); end; // This is for HUB OnSkillInvoke: if (!playerattached()) end; HUB_SkillInvoke(); @skillId=0; end; OnPCBonusEvent: if (!playerattached()) end; HUB_PCBonus(); end; OnGlobalChat: .@msg$ = @chat$; // We don't care with punctuation or capitalization .@msg$ = strtolower(.@msg$); .@msg$ = replacestr(.@msg$, ",", ""); .@msg$ = replacestr(.@msg$, ".", ""); .@msg$ = replacestr(.@msg$, "!", ""); .@msg$ = replacestr(.@msg$, ":", ""); .@msg$ = replacestr(.@msg$, ";", ""); .@msg$ = replacestr(.@msg$, "(", ""); .@msg$ = replacestr(.@msg$, ")", ""); .@msg$ = replacestr(.@msg$, "<", ""); .@msg$ = replacestr(.@msg$, ">", ""); .@msg$ = replacestr(.@msg$, "*", ""); // Magic System callfunc "Crossroads_Magic", .@msg$; end; // Level up events OnPCBaseLvUpEvent: end; // Death & Logout events OnPCDieEvent: @qhub_died=1; OnPCLogoutEvent: HUB_Logout(@qhub_died); @qhub_died=0; end; // Every time the server starts, clean up possibly broken data about treasures. // NPC ID might have changed. OnInterIfInitOnce: atcommand("@channel setopt #world MessageDelay 1"); $@HAS_API=apiasync("PING", ""); query_sql("DELETE FROM `char_reg_num_db` WHERE `key`='RNGTREASURE_DATE'"); query_sql("DELETE FROM `char_reg_num_db` WHERE `key`='PVP_COOLDOWN'"); query_sql("DELETE FROM `char_reg_num_db` WHERE `key`='CHAREG_CLEANUP'"); end; // This control all PC Login events // Position matters! OnPCLoginEvent: // Vault override if (#MerchantBank) { if (#MerchantBank < 0) consolebug("Negative bank data for %s!", strcharinfo(0)); BankVault += #MerchantBank; #MerchantBank = 0; } // Cannot login with outdated client checkclientversion(); // Message of the Day have priority MOTDHandler(); // Scheduled Announces StoneBoardRead(); // TODO: npc/commands/rate-management.txt // Main update handler clientupdater(); // Position and gameplay fixes HUB_Login(); // Alcohol system reset ALCReset(); // Daily rewards (The first with dialog interactions) daily_login_bonus_handler(); // Guild Weekly Login Bonus guild_login_bonus(); // Thanksgiving Event sThanksgiving(); end; } /* Some hacks */ function script refinesync { return; }