diff options
author | Jesusaves <cpntb1@ymail.com> | 2020-04-28 05:30:09 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2020-04-28 05:30:09 -0300 |
commit | f388b641e02a5217765a9676ecb7ef68467caf37 (patch) | |
tree | f2e03827c73f5b45d9140c152c81ac3f2ca32a95 | |
parent | acf9038150b5af1078fee8a080b0870390480c23 (diff) | |
download | serverdata-f388b641e02a5217765a9676ecb7ef68467caf37.tar.gz serverdata-f388b641e02a5217765a9676ecb7ef68467caf37.tar.bz2 serverdata-f388b641e02a5217765a9676ecb7ef68467caf37.tar.xz serverdata-f388b641e02a5217765a9676ecb7ef68467caf37.zip |
Fixes, and make possible to learn guild skills
-rw-r--r-- | npc/functions/hub.txt | 2 | ||||
-rw-r--r-- | npc/guilds/logs.txt | 131 | ||||
-rw-r--r-- | npc/magic/guild.txt | 6 | ||||
-rw-r--r-- | npc/scripts.conf | 1 |
4 files changed, 136 insertions, 4 deletions
diff --git a/npc/functions/hub.txt b/npc/functions/hub.txt index 49d7355a5..c38f4a325 100644 --- a/npc/functions/hub.txt +++ b/npc/functions/hub.txt @@ -228,7 +228,7 @@ function script HUB_SkillInvoke { GD_allboost(); break; case TMW2_GD_REGEN: - GD_regeneration(); + GD_regenerating(); break; case TMW2_GD_DEFUP: GD_defboost(); diff --git a/npc/guilds/logs.txt b/npc/guilds/logs.txt index 1463d5b13..0a1b06058 100644 --- a/npc/guilds/logs.txt +++ b/npc/guilds/logs.txt @@ -9,6 +9,7 @@ guilds,47,39,0 script Guild Logs NPC_NO_SPRITE,{ function showRecipe; function calcRecipe; function clearRecipe; + function GDSkillLearn; .@gid=getcharid(2); .@s=0; // How many was displayed, to use next(); if needed @@ -92,6 +93,7 @@ guilds,47,39,0 script Guild Logs NPC_NO_SPRITE,{ select l("Do nothing"), rif(strcharinfo(0) == getguildmaster(.@gid), l("Raise max members")), + rif(.@role == GPOS_TREASURER || .@role <= GPOS_VICELEADER, l("Learn individual guild skills")), l("Learn Alchemy Recipes"); mes ""; @@ -122,6 +124,84 @@ guilds,47,39,0 script Guild Logs NPC_NO_SPRITE,{ } break; case 3: + mes ".:: " + l("Guild Magic") + " ::."; + do + { + select + l("Return"), + rif(strcharinfo(0) == getguildmaster(.@gid), l("Increase all stats")), + l("Guild Area Regeneration"), + l("Guild Area DEF UP"), + l("Guild's Battle Plan"), + l("Guild Area ATK UP"), + l("Guild Area CRIT UP"), + l("Guild Area Autorevive"), + l("Weapon Maximum Damage"), + l("Friendly SP Regeneration"); + + mes ""; + switch (@menu) { + case 2: + GDSkillLearn(TMW2_GD_INCALL, 2580, + l("Guild's Power"), + l("Increase all stats from every guild member in area."), + 8, 12, 16, 20, 24, 30, 36, 42, 50); + break; + case 3: + GDSkillLearn(TMW2_GD_REGEN, 1740, + l("Angel Light"), + l("Causes a healing effect in area to guild members."), + 4, 6, 9, 12, 15, 20, 25, 30, 35); + break; + case 4: + GDSkillLearn(TMW2_GD_DEFUP, 640, + l("Blessing of Defense"), + l("Increase defense to all friends in radius."), + 3, 5, 7, 9, 11, 14, 17, 20, 25); + break; + case 5: + GDSkillLearn(TMW2_GD_BATTLEPLAN, 1015, + l("Battle Plans"), + l("Increase STR/INT/DEX in range for all guild allies."), + 5, 8, 11, 15, 20, 24, 30, 37, 42); + break; + case 6: + GDSkillLearn(TMW2_GD_ATKUP, 1500, + l("Damage Improvement"), + l("Increase damage dealt by weapon for all guildies."), + 2, 4, 6, 8, 10, 12, 15, 18, 21); + break; + case 7: + GDSkillLearn(TMW2_GD_CRITUP, 1500, + l("Critical Fortune"), + l("Increase critical chance of all guild allies."), + 6, 9, 13, 19, 22, 27, 33, 39, 45); + break; + case 8: + GDSkillLearn(TMW2_GD_AUTOREVIVE, 3000, + l("Blessing of Immortality"), + l("If a guild mate dies, they will revive. Don't work on self."), + 7, 11, 17, 23, 26, 29, 31, 34, 38); + break; + case 9: + GDSkillLearn(TMW2_GDP_MAXPOWER, 3000, + l("Maximize Damage"), + l("PARTY AND GUILD friends: Weapon always deal max damage."), + 1, 5, 10, 15, 20, 25, 30, 35, 40); + break; + case 10: + GDSkillLearn(TMW2_GDP_SPREGEN, 3000, + l("Improved MP Regen"), + l("PARTY AND GUILD friends: Temporaly regen MP faster."), + 5, 10, 15, 22, 28, 32, 37, 41, 44); + break; + default: + break; + } + } while (@menu != 1); + @menu=99; + break; + case 4: mes ".:: " + l("Alchemy Recipes") + " ::."; do { clearRecipe(); @@ -280,6 +360,57 @@ function hudRecipe { return 0; } +// GDSkillLearn(SKID, cost-per-guild-level, title, desc, lv1, {lv2, lv3...}) +function GDSkillLearn { + .@id=getarg(0); + .@p=getarg(1); + .@t$=getarg(2); + .@d$=getarg(3); + + .@gid=getcharid(2); + .@gid_lv=getguildlvl(.@gid); + .@cur_lv=getskilllv(.@id); + .@min_lv=getarg(4+.@cur_lv, -1); + + .@price=.@min_lv*.@p; + + // Max level reached + if (.@min_lv < 0) + { + mesc l("This skill cannot be upgraded further."); + next; + return 0; + } + + // Guild level insuffice + if (.@gid_lv < .@min_lv) + { + mesc l("Guild Level is not enough: @@/@@", .@gid_lv, .@min_lv); + next; + return 0; + } + + mes ".:: "+.@t$+" ::."; + mes .@d$; + mesc l("The cost for Guild Vault is @@ GP.", format_number(.@price)); + mesc l("Current Guild Balance: %s GP", format_number($GUILD_BANK[.@gid])); + next; + select + rif($GUILD_BANK[.@gid] >= .@price, l("Upgrade it")), + l("Don't upgrade it"); + mes ""; + if (@menu == 1 && $GUILD_BANK[.@gid] >= .@price) + { + $GUILD_BANK[.@gid]-=.@price; + // guildskill()? + skill .@id, .@cur_lv+1, 0; + mesc l("Skill improved"), 2; + @menu=99; + return 1; + } + return 0; +} + OnInit: .distance=2; end; diff --git a/npc/magic/guild.txt b/npc/magic/guild.txt index 151a95154..43c46db92 100644 --- a/npc/magic/guild.txt +++ b/npc/magic/guild.txt @@ -65,10 +65,10 @@ function script GD_allboost { // GD_regeneration ( lv ) // 12x12 HP and MP recovery -function script GD_regeneration { +function script GD_regenerating { .@lv=getarg(0, @skillLv); // range, time, SC, BL, power, filter - areasc(12, 8000+(1000*.@lv), SC_INCALLSTATUS, BL_PC, 15+(5*.@lv), "filter_sameguild"); + areasc(12, 8000+(1000*.@lv), SC_GDSKILL_REGENERATION, BL_PC, 15+(5*.@lv), "filter_sameguild"); return; } @@ -154,7 +154,7 @@ function script SK_maximizepower { function script SK_spregen { .@lv=getarg(0, @skillLv); // range, time, SC, BL, 1, power, filter - areasc(.@lv, 20000*.@lv, SC_MAGNIFICAT, BL_PC, 1, "filter_sameguildorparty"); + areasc(.@lv, 20000+(10000*.@lv), SC_MAGNIFICAT, BL_PC, 1, "filter_sameguildorparty"); return; } diff --git a/npc/scripts.conf b/npc/scripts.conf index 89afddc45..bc1cbb246 100644 --- a/npc/scripts.conf +++ b/npc/scripts.conf @@ -123,6 +123,7 @@ "npc/magic/dragokin.txt", "npc/magic/fairykingdom.txt", "npc/magic/frozenheart.txt", +"npc/magic/guild.txt", "npc/magic/halhiss.txt", "npc/magic/kalboo.txt", "npc/magic/kalmurk.txt", |