From e4830b178bab603f24a1eb60cf805ca5e04c4138 Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 22 May 2020 16:04:46 -0300 Subject: Guild Weekly Login Bonus. Every 20 average levels give you a bonus coin (capped at Lv 100) Every 5 guild levels give you a bonus coin (capped at Lv 50) --- npc/003-3/malindou.txt | 3 +++ npc/functions/daily.txt | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/npc/003-3/malindou.txt b/npc/003-3/malindou.txt index 38eb11483..750a50ab4 100644 --- a/npc/003-3/malindou.txt +++ b/npc/003-3/malindou.txt @@ -720,6 +720,9 @@ OnPCLoginEvent: // Daily rewards (The first with dialog interactions) daily_login_bonus_handler(); + // Guild Weekly Login Bonus + guild_login_bonus(); + // Thanksgiving Event sThanksgiving(); end; diff --git a/npc/functions/daily.txt b/npc/functions/daily.txt index 13997ba56..23dfc00b5 100644 --- a/npc/functions/daily.txt +++ b/npc/functions/daily.txt @@ -198,3 +198,18 @@ function script daily_login_bonus_handler { return; } +// Gives you guild coins, but weekly (based on Guild Level) +function script guild_login_bonus { + .@g=getcharid(2); + if (.@g < 1) + return; + + .@c=min(5, getguildavg(.@g)/20)+limit(1, getguildlvl(.@g)/5, 10); + if (#LOGIN_GUILD_WEEK != gettimeparam(GETTIME_WEEKDAY)) { + #LOGIN_GUILD_WEEK=gettimeparam(GETTIME_WEEKDAY); + getitem GuildCoin, .@c; + dispbottom l("##2Guild's Weekly login bonus: ##B%d %s##b", .@c, getitemlink(GuildCoin)); + } + return; +} + -- cgit v1.2.3-60-g2f50