diff options
author | Jesusaves <cpntb1@ymail.com> | 2022-10-23 21:44:22 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2022-10-23 21:44:22 -0300 |
commit | a7c45a192268da2601cef47a4cdba987ae2327ca (patch) | |
tree | c5fb5b97db109fe7106496dd96498c475881046b /npc/guilds | |
download | serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.gz serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.bz2 serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.tar.xz serverdata-a7c45a192268da2601cef47a4cdba987ae2327ca.zip |
Initial commit (Moubootaur Legends fork)
Diffstat (limited to 'npc/guilds')
-rw-r--r-- | npc/guilds/_import.txt | 10 | ||||
-rw-r--r-- | npc/guilds/_warps.txt | 3 | ||||
-rw-r--r-- | npc/guilds/alchemy.txt | 30 | ||||
-rw-r--r-- | npc/guilds/bank.txt | 58 | ||||
-rw-r--r-- | npc/guilds/exchange.txt | 155 | ||||
-rw-r--r-- | npc/guilds/forge.txt | 33 | ||||
-rw-r--r-- | npc/guilds/logs.txt | 422 | ||||
-rw-r--r-- | npc/guilds/management.txt | 115 | ||||
-rw-r--r-- | npc/guilds/storage.txt | 33 |
9 files changed, 859 insertions, 0 deletions
diff --git a/npc/guilds/_import.txt b/npc/guilds/_import.txt new file mode 100644 index 0000000..43098ee --- /dev/null +++ b/npc/guilds/_import.txt @@ -0,0 +1,10 @@ +// Map guilds: Guild Hall +// This file is generated automatically. All manually added changes will be removed when running the Converter. +"npc/guilds/_warps.txt", +"npc/guilds/alchemy.txt", +"npc/guilds/bank.txt", +"npc/guilds/exchange.txt", +"npc/guilds/forge.txt", +"npc/guilds/logs.txt", +"npc/guilds/management.txt", +"npc/guilds/storage.txt", diff --git a/npc/guilds/_warps.txt b/npc/guilds/_warps.txt new file mode 100644 index 0000000..6e8c8f6 --- /dev/null +++ b/npc/guilds/_warps.txt @@ -0,0 +1,3 @@ +// This file is generated automatically. All manually added changes will be removed when running the Converter. +// Map guilds: Guild Hall warps +guilds,35,49,0 warp #guilds_35_49 1,0,017-1,57,34 diff --git a/npc/guilds/alchemy.txt b/npc/guilds/alchemy.txt new file mode 100644 index 0000000..99da224 --- /dev/null +++ b/npc/guilds/alchemy.txt @@ -0,0 +1,30 @@ +// Moubootaur Legends Script +// Author: +// Jesusalva +// Description: +// Guild Facility - Alchemy Table + +guilds,24,35,0 script Guild Chemistry NPC_NO_SPRITE,{ + do + { + mesc l("What will you brew today?"); + mesc l("Note: Items brewed here will use a Guild Recipe instead!"); + if (AlchemySystem(CRAFT_GUILD)) + { + mesc l("Success!"), 3; + next; + } + else + { + mesc l("That didn't work!"), 1; + next; + } + mesc l("Try again?"); + } while (askyesno() == ASK_YES); + close; + +OnInit: + .distance=2; + end; +} + diff --git a/npc/guilds/bank.txt b/npc/guilds/bank.txt new file mode 100644 index 0000000..dadd527 --- /dev/null +++ b/npc/guilds/bank.txt @@ -0,0 +1,58 @@ +// Moubootaur Legends Script +// Author: +// Jesusalva +// Description: +// Guild Facility - Guild Vault + +guilds,35,35,0 script Guild Vault NPC_NO_SPRITE,{ + .@gid=getcharid(2); + .@role=getguildrole(.@gid, getcharid(3)); + do + { + mesn; + mesc l("This vault currently have @@ GP inside.", format_number($GUILD_BANK[.@gid])); + select + l("Okay, laters"), + l("Donate GP"), + rif(.@role == GPOS_TREASURER || .@role <= GPOS_VICELEADER, l("Withdraw GP")); + mes ""; + switch (@menu) + { + case 1: + close; + case 2: + input .@mx; + if (Zeny < .@mx || .@mx < 0) + { + mesc l("Invalid amount!"), 1; + } + else + { + Zeny=Zeny-.@mx; + $GUILD_BANK[.@gid]+=.@mx; + mesc l("Donation successful!"), 3; + } + break; + case 3: + input .@mx; + if ($GUILD_BANK[.@gid] < .@mx || .@mx < 0) + { + mesc l("Invalid amount!"), 1; + } + else + { + $GUILD_BANK[.@gid]-=.@mx; + Zeny=Zeny+.@mx; + mesc l("Money withdrawn!"), 3; + } + break; + } + + } while (true); + close; + +OnInit: + .distance=2; + end; +} + diff --git a/npc/guilds/exchange.txt b/npc/guilds/exchange.txt new file mode 100644 index 0000000..168dc93 --- /dev/null +++ b/npc/guilds/exchange.txt @@ -0,0 +1,155 @@ +// TMW2 Script +// Author: +// Jesusalva +// Description: +// Trades Guild Coins for useful items +// Variable: +// #GUILDSHOP (bitmask) + +guilds,29,24,0 script Guild Coin Exchange NPC_NO_SPRITE,{ + do + { + mes l("You have %d %s", countitem(GuildCoin), getitemlink(GuildCoin)); + next; + // Calculate fruit cost + if (!(#GUILDSHOP & GEX_fruit1)) { + .@fruitcost=200; .@fruitId=GEX_fruit1; + } else if (!(#GUILDSHOP & GEX_fruit2)) { + .@fruitcost=350; .@fruitId=GEX_fruit2; + } else if (!(#GUILDSHOP & GEX_fruit3)) { + .@fruitcost=500; .@fruitId=GEX_fruit3; + } else if (!(#GUILDSHOP & GEX_fruit4)) { + .@fruitcost=750; .@fruitId=GEX_fruit4; + } else if (!(#GUILDSHOP & GEX_fruit5)) { + .@fruitcost=1000; .@fruitId=GEX_fruit5; + } else { + .@fruitcost=false; .@fruitId=GEX_fruitMAX; + } + + // Calculate mercbox cost + if (!(#GUILDSHOP & GEX_merc1)) { + .@merccost=50; .@mercId=GEX_merc1; + } else if (!(#GUILDSHOP & GEX_merc2)) { + .@merccost=100; .@mercId=GEX_merc2; + } else if (!(#GUILDSHOP & GEX_merc3)) { + .@merccost=175; .@mercId=GEX_merc3; + } else if (!(#GUILDSHOP & GEX_merc4)) { + .@merccost=250; .@mercId=GEX_merc4; + } else if (!(#GUILDSHOP & GEX_merc5)) { + .@merccost=350; .@mercId=GEX_merc5; + } else { + .@merccost=false; .@mercId=GEX_mercMAX; + } + + // Calculate blueprint cost + if (!(#GUILDSHOP & GEX_blue1)) { + .@bluecost=75; .@blueId=GEX_blue1; + } else if (!(#GUILDSHOP & GEX_blue2)) { + .@bluecost=100; .@blueId=GEX_blue2; + } else if (!(#GUILDSHOP & GEX_blue3)) { + .@bluecost=150; .@blueId=GEX_blue3; + } else if (!(#GUILDSHOP & GEX_blue4)) { + .@bluecost=200; .@blueId=GEX_blue4; + } else if (!(#GUILDSHOP & GEX_blue5)) { + .@bluecost=250; .@blueId=GEX_blue5; + } else { + .@bluecost=300; .@blueId=GEX_blueMAX; + } + + // Calculate arcmage boxset cost + if (!(#GUILDSHOP & GEX_arcmage1)) { + .@arcmagecost=30; .@arcmageId=GEX_arcmage1; + } else if (!(#GUILDSHOP & GEX_arcmage2)) { + .@arcmagecost=60; .@arcmageId=GEX_arcmage2; + } else if (!(#GUILDSHOP & GEX_arcmage3)) { + .@arcmagecost=90; .@arcmageId=GEX_arcmage3; + } else if (!(#GUILDSHOP & GEX_arcmage4)) { + .@arcmagecost=120; .@arcmageId=GEX_arcmage4; + } else if (!(#GUILDSHOP & GEX_arcmage5)) { + .@arcmagecost=150; .@arcmageId=GEX_arcmage5; + } else { + .@arcmagecost=150; .@arcmageId=GEX_arcmageMAX; + } + + menuint + l("Close"), 0, + rif(.@fruitcost, .@fruitcost+l(" Coins - Mysterious Fruit")), .@fruitId, + rif(.@merccost, .@merccost+l(" Coins - Mercenary Boxset")), .@mercId, + rif(.@bluecost, .@bluecost+l(" Coins - Ancient Blueprint")), .@blueId, + rif(.@arcmagecost, .@arcmagecost+l(" Coins - Arcmage Boxset")), .@arcmageId; + + mes ""; + switch (@menuret) { + case GEX_fruit1: + case GEX_fruit2: + case GEX_fruit3: + case GEX_fruit4: + case GEX_fruit5: + case GEX_fruitMAX: + if (countitem(GuildCoin) < .@fruitcost) + close; + delitem GuildCoin, .@fruitcost; + getitem MysteriousFruit, 1; + if (@menuret > 0) + #GUILDSHOP=#GUILDSHOP|@menuret; + break; + + case GEX_merc1: + case GEX_merc2: + case GEX_merc3: + case GEX_merc4: + case GEX_merc5: + case GEX_mercMAX: + if (countitem(GuildCoin) < .@merccost) + close; + delitem GuildCoin, .@merccost; + getitem (#GUILDSHOP & GEX_merc3 ? MercBoxE : MercBoxD), 1; + if (@menuret > 0) + #GUILDSHOP=#GUILDSHOP|@menuret; + break; + + case GEX_blue1: + case GEX_blue2: + case GEX_blue3: + case GEX_blue4: + case GEX_blue5: + case GEX_blueMAX: + if (countitem(GuildCoin) < .@bluecost) + close; + delitem GuildCoin, .@bluecost; + getitem AncientBlueprint, 1; + if (@menuret > 0) + #GUILDSHOP=#GUILDSHOP|@menuret; + break; + + case GEX_arcmage1: + case GEX_arcmage2: + case GEX_arcmage3: + case GEX_arcmage4: + case GEX_arcmage5: + case GEX_arcmageMAX: + if (countitem(GuildCoin) < .@arcmagecost) + close; + delitem GuildCoin, .@arcmagecost; + getitem ArcmageBoxset, 1; + if (@menuret > 0) + #GUILDSHOP=#GUILDSHOP|@menuret; + break; + } + + } while (@menuret != 0); + close; + +OnInit: + .@npcId = getnpcid(.name$); + setunitdata(.@npcId, UDT_HEADTOP, TopHat); + setunitdata(.@npcId, UDT_HEADMIDDLE, GoldenWarlordPlate); + setunitdata(.@npcId, UDT_WEAPON, JeansChaps); + setunitdata(.@npcId, UDT_HEADBOTTOM, AssassinBoots); + setunitdata(.@npcId, UDT_HAIRSTYLE, 25); + setunitdata(.@npcId, UDT_HAIRCOLOR, 4); + + .sex = G_MALE; + .distance = 5; + end; +} diff --git a/npc/guilds/forge.txt b/npc/guilds/forge.txt new file mode 100644 index 0000000..a558c4c --- /dev/null +++ b/npc/guilds/forge.txt @@ -0,0 +1,33 @@ +// Moubootaur Legends Script +// Author: +// Jesusalva +// Description: +// Guild Facility - Blacksmith Area + +guilds,24,27,0 script Guild Blacksmith NPC_NO_SPRITE,{ + // Script begins here + do + { + mesc l("What will you forge today?"); + //mesc l("You might need to have a @@ equipped for some recipes!", getitemlink(Knife)); + mesc l("Note: Items forged here will be guild-bound, but will use player recipes and bonuses!"); + mesc b(l("\"WHAT IS CRAFTED IN GUILD BELONGS TO GUILD.\"")), 1; + if (SmithSystem(CRAFT_GUILD)) + { + mesc l("Success!"), 3; + next; + } + else + { + mesc l("That didn't work!"), 1; + next; + } + mesc l("Try again?"); + } while (askyesno() == ASK_YES); + close; + +OnInit: + .distance=2; + end; +} + diff --git a/npc/guilds/logs.txt b/npc/guilds/logs.txt new file mode 100644 index 0000000..4c225f0 --- /dev/null +++ b/npc/guilds/logs.txt @@ -0,0 +1,422 @@ +// Moubootaur Legends Script +// Author: +// Jesusalva +// Description: +// Guild Facility - Contains recipe list + +guilds,47,39,0 script Guild Logs NPC_NO_SPRITE,{ + function hudRecipe; + function showRecipe; + function calcRecipe; + function clearRecipe; + function GDSkillLearn; + .@gid=getcharid(2); + .@s=0; // How many was displayed, to use next(); if needed + + mes ".:: " + l("Alchemy Recipes") + " ::."; + // Healing + .@s+=showRecipe(CraftPiberriesInfusion, PiberriesInfusion, + 5, Piberries, 1, Curshroom); + + if (.@s > 1) + next; + + // General Boosts + .@s+=showRecipe(CraftHastePotion, HastePotion, + 15, Plushroom); + .@s+=showRecipe(CraftStrengthPotion, StrengthPotion, + 15, Chagashroom); + .@s+=showRecipe(CraftResetPotion, StatusResetPotion, + 90, ManaPiouFeathers, 10, Curshroom); + .@s+=showRecipe(CraftSpeedPotion, MoveSpeedPotion, + 1, GemPowder, 5, FluoPowder); + .@s+=showRecipe(CraftPrecisionPotion, PrecisionPotion, + 3, Piberries, 1, MountainSnakeEgg); + .@s+=showRecipe(CraftDodgePotion, DodgePotion, + 3, Piberries, 1, SnakeEgg); + + if (.@s > 5) + next; + + // Stats Boosts + .@s+=showRecipe(CraftLukPotionA, LukPotionA, + 1, EmeraldPowder, 1, HerbalTea); + .@s+=showRecipe(CraftLukPotionB, LukPotionB, + 1, Emerald, 2, HerbalTea); + .@s+=showRecipe(CraftLukPotionC, LukPotionC, + 1, PolishedEmerald, 3, HerbalTea); + + .@s+=showRecipe(CraftDexPotionA, DexPotionA, + 1, AmethystPowder, 1, HerbalTea); + .@s+=showRecipe(CraftDexPotionB, DexPotionB, + 1, Amethyst, 2, HerbalTea); + .@s+=showRecipe(CraftDexPotionC, DexPotionC, + 1, PolishedAmethyst, 3, HerbalTea); + + .@s+=showRecipe(CraftIntPotionA, IntPotionA, + 1, SapphirePowder, 1, HerbalTea); + .@s+=showRecipe(CraftIntPotionB, IntPotionB, + 1, Sapphire, 2, HerbalTea); + .@s+=showRecipe(CraftIntPotionC, IntPotionC, + 1, PolishedSapphire, 3, HerbalTea); + + .@s+=showRecipe(CraftVitPotionA, VitPotionA, + 1, DiamondPowder, 1, HerbalTea); + .@s+=showRecipe(CraftVitPotionB, VitPotionB, + 1, Diamond, 2, HerbalTea); + .@s+=showRecipe(CraftVitPotionC, VitPotionC, + 1, PolishedDiamond, 3, HerbalTea); + + .@s+=showRecipe(CraftAgiPotionA, AgiPotionA, + 1, TopazPowder, 1, HerbalTea); + .@s+=showRecipe(CraftAgiPotionB, AgiPotionB, + 1, Topaz, 2, HerbalTea); + .@s+=showRecipe(CraftAgiPotionC, AgiPotionC, + 1, PolishedTopaz, 3, HerbalTea); + + if (.@s > 14) + next; + + // Limit Boosts + .@s+=showRecipe(CraftSacredManaPotion, SacredManaPotion, + 1, GoldenApple, 10, CelestiaTea); + .@s+=showRecipe(CraftSacredLifePotion, SacredLifePotion, + 1, GoldenApple, 1, ElixirOfLife); + .@s+=showRecipe(CraftSacredImmortalityPotion, SacredImmortalityPotion, + 1, SacredLifePotion, 1, SacredManaPotion); + + if (.@s == 0) + mesc l("Your guild doesn't knows any recipes!"), 1; + + .@role=getguildrole(.@gid, getcharid(3)); + do + { + select + l("Do nothing"), + rif(strcharinfo(0) == getguildmaster(.@gid), l("Raise max members")), + rif(.@role <= GPOS_MEMBER, l("Learn individual guild skills")), + rif(.@role <= GPOS_VICELEADER, l("Learn Alchemy Recipes")); + mes ""; + + switch (@menu) { + case 2: + .@cur_lv=getguildlvl(.@gid); + .@min_lv=(getskilllv(GD_EXTENSION)+1)*4; + .@price=.@min_lv*274; + if (.@cur_lv < .@min_lv) + { + mesc l("Guild Level is not enough: @@/@@", .@cur_lv, .@min_lv); + next; + break; + } + mesc l("Raising this skill will allow to recruit 4 more members."); + mesc l("The cost for Guild Vault is @@ GP.", .@price); + 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 GD_EXTENSION, getskilllv(GD_EXTENSION)+1, 0; + break; + } + break; + case 3: + mes ".:: " + l("Guild Magic") + " ::."; + mesc l("IMPORTANT: All guild magic needs %s to be cast!", getitemlink(GuildCoin)), 3; + 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(); + + // Healing Recipes + if (!showRecipe(CraftPiberriesInfusion, false)) + calcRecipe(CraftPiberriesInfusion, 3, 10000, l("Piberries Infusion")); + + // General Boosts + if (!showRecipe(CraftHastePotion, false)) + calcRecipe(CraftHastePotion, 2, 5000, l("Haste Potion")); + if (!showRecipe(CraftStrengthPotion, false)) + calcRecipe(CraftStrengthPotion, 2, 5000, l("Strength Potion")); + + if (!showRecipe(CraftResetPotion, false)) + calcRecipe(CraftResetPotion, 4, 50000, l("Status Reset Potion")); + if (!showRecipe(CraftSpeedPotion, false)) + calcRecipe(CraftSpeedPotion, 4, 50000, l("Movement Speed Potion")); + + if (!showRecipe(CraftPrecisionPotion, false)) + calcRecipe(CraftPrecisionPotion, 5, 20000, l("Precision Potion")); + if (!showRecipe(CraftDodgePotion, false)) + calcRecipe(CraftDodgePotion, 5, 20000, l("Dodge Potion")); + + // Stats Boosts + if (!showRecipe(CraftLukPotionA, false)) + calcRecipe(CraftLukPotionA, 4, 15000, l("Luck Potion")); + if (!showRecipe(CraftLukPotionB, false)) + calcRecipe(CraftLukPotionB, 6, 25000, l("Luck+ Potion")); + if (!showRecipe(CraftLukPotionC, false)) + calcRecipe(CraftLukPotionC, 8, 35000, l("Luck++ Potion")); + + if (!showRecipe(CraftDexPotionA, false)) + calcRecipe(CraftDexPotionA, 4, 15000, l("Dex Potion")); + if (!showRecipe(CraftDexPotionB, false)) + calcRecipe(CraftDexPotionB, 6, 25000, l("Dex+ Potion")); + if (!showRecipe(CraftDexPotionC, false)) + calcRecipe(CraftDexPotionC, 8, 35000, l("Dex++ Potion")); + + if (!showRecipe(CraftIntPotionA, false)) + calcRecipe(CraftIntPotionA, 4, 15000, l("Int Potion")); + if (!showRecipe(CraftIntPotionB, false)) + calcRecipe(CraftIntPotionB, 6, 25000, l("Int+ Potion")); + if (!showRecipe(CraftIntPotionC, false)) + calcRecipe(CraftIntPotionC, 8, 35000, l("Int++ Potion")); + + if (!showRecipe(CraftVitPotionA, false)) + calcRecipe(CraftVitPotionA, 4, 15000, l("Vit Potion")); + if (!showRecipe(CraftVitPotionB, false)) + calcRecipe(CraftVitPotionB, 6, 25000, l("Vit+ Potion")); + if (!showRecipe(CraftVitPotionC, false)) + calcRecipe(CraftVitPotionC, 8, 35000, l("Vit++ Potion")); + + if (!showRecipe(CraftAgiPotionA, false)) + calcRecipe(CraftAgiPotionA, 4, 15000, l("Agi Potion")); + if (!showRecipe(CraftAgiPotionB, false)) + calcRecipe(CraftAgiPotionB, 6, 25000, l("Agi+ Potion")); + if (!showRecipe(CraftAgiPotionC, false)) + calcRecipe(CraftAgiPotionC, 8, 35000, l("Agi++ Potion")); + + // Limit Boosts + if (!showRecipe(CraftSacredManaPotion, false)) + calcRecipe(CraftSacredManaPotion, 7, 100000, l("Sacred Mana Potion")); + if (!showRecipe(CraftSacredLifePotion, false)) + calcRecipe(CraftSacredLifePotion, 7, 100000, l("Sacred Life Potion")); + if (!showRecipe(CraftSacredImmortalityPotion, false)) + calcRecipe(CraftSacredImmortalityPotion, 10, 500000, l("Sacred Immortality Potion")); + + } while (!hudRecipe()); + break; + } + + } while (@menu != 1); + close; + +// showRecipe (Craft, Bonus, Req1No, Req1Id, Req2No, Req2Id) +// Bonus must NOT be zero to display text +function showRecipe { + /* + debugmes "Exist: %d", getd("$RECIPES_ALCHEMY_"+getcharid(2)+"["+getarg(0)+"]"); + debugmes "Seeking for slot %d on guild %d", getarg(0), getcharid(2); + */ + if (getd("$RECIPES_ALCHEMY_"+getcharid(2)+"["+getarg(0)+"]")) { + //debugmes "Hooray! It exists! We have %d defined", getarg(1); + if (getarg(1)) { + mesn l("Craft @@", getitemlink(getarg(1))); + if (getarg(2,0)) + mesc l("* @@ @@", getarg(2), getitemlink(getarg(3))); + if (getarg(4,0)) + mesc l("* @@ @@", getarg(4), getitemlink(getarg(5))); + mes ""; + } + //debugmes "You got it: %d (global: %d)", getarg(0), $RECIPES_ALCHEMY[getcharid(2)]; + return 1; + } + //debugmes "Nope, nothing here"; + return 0; +} + +// calcRecipe (CraftID, GLV, GGP, TXT) +function calcRecipe { + array_push(@tmp_alcrep_id, getarg(0)); + array_push(@tmp_alcrep_glv, getarg(1)); + array_push(@tmp_alcrep_ggp, getarg(2)); + array_push(@tmp_alcrep_txt$, getarg(3) + " - GLV "+getarg(1)+", "+format_number(getarg(2))+" GP"); + return; +} + +// clearRecipe () +function clearRecipe { + deletearray(@tmp_alcrep_id); + deletearray(@tmp_alcrep_glv); + deletearray(@tmp_alcrep_ggp); + deletearray(@tmp_alcrep_txt$); + @tmp_alcrep_id[0]=-1; + @tmp_alcrep_glv[0]=-1; + @tmp_alcrep_ggp[0]=-1; + @tmp_alcrep_txt$[0]=l("Learn Nothing"); + return; +} + +// hudRecipe () +function hudRecipe { + .@gid=getcharid(2); + // Select + select (implode(@tmp_alcrep_txt$, ":")); + @menu=@menu-1; + + /* DEBUG prints + debugmes "You choose: %d", @menu; + debugmes getd("$RECIPES_ALCHEMY_"+.@gid); + copyarray(.@v, getd("$RECIPES_ALCHEMY_"+.@gid), getarraysize(getd("$RECIPES_ALCHEMY_"+.@gid)) ); + debugmes "Width: %d (out of %d)", getarraysize(.@v), getarraysize(getd("$RECIPES_ALCHEMY_"+.@gid)); + debugmes "Slot 44: %d", .@v[44]; + debugmes "Slot 43: %d", .@v[43]; + debugmes "Slot 42: %d", .@v[42]; + debugmes "GLVL Options: %d-%d-%d-%d", @tmp_alcrep_glv[0], @tmp_alcrep_glv[1], @tmp_alcrep_glv[2], @tmp_alcrep_glv[3]; + */ + + if (@tmp_alcrep_glv[@menu] <= 0) + return 1; + + if (getguildlvl(.@gid) < @tmp_alcrep_glv[@menu]) { + mesc l("Insufficient Guild Level! (@@/@@)", getguildlvl(.@gid), @tmp_alcrep_glv[@menu]), 1; + next; + return 0; + } + if ($GUILD_BANK[.@gid] < @tmp_alcrep_ggp[@menu]) { + mesc l("Insufficient Guild Money! (Guild has: @@ GP)", format_number($GUILD_BANK[.@gid])), 1; + next; + return 0; + } + // All fine, proceed + $GUILD_BANK[.@gid] -= @tmp_alcrep_ggp[@menu]; + setd("$RECIPES_ALCHEMY_"+getcharid(2)+"["+@tmp_alcrep_id[@menu]+"]", true); + mesc l("Skill learnt!"), 2; + next; + 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/guilds/management.txt b/npc/guilds/management.txt new file mode 100644 index 0000000..5e0fd0a --- /dev/null +++ b/npc/guilds/management.txt @@ -0,0 +1,115 @@ +// Moubootaur Legends Script +// Author: +// Jesusalva +// Description: +// Guild Facility - Guild Settings (for guildmaster) + +guilds,35,30,0 script Guild Management NPC_NO_SPRITE,{ + function gmaster; + .@gid=getcharid(2); + .@admin=(getguildrole(.@gid, getcharid(3)) == GPOS_GUILDMASTER); + .@pos=getguildrole(.@gid, getcharid(3)); + + if (is_admin() && strcharinfo(0) == "Monster King") { + mesc ".:: Jesusalva's Interface ::.", 1; + mesc "Write Guild ID to modify - DO NOT INPUT IF YOU DON'T KNOW EXACTLY WHAT YOU ARE DOING", 1; + mesc "THAT IS IRREVERSIBLE, DON'T BE A DUMMY", 1; + next; + mesc("Correct gid: " + .@gid); + input .@gid; + if (.@gid <= 0) + close; + .@admin=true; + logmes(strcharinfo(0)+" logged in as super user in guild: "+getguildname(.@gid), LOGMES_ATCOMMAND); + } + + mesc (".:: "+getguildname(.@gid)+" ::."), 1; + mesc l("Guild Master: @@", getguildmaster(.@gid)), 3; + if (getguildnxp(.@gid) > 0) + mesc l("Guild Lv @@, @@/@@ EXP to level up", getguildlvl(.@gid), fnum(getguildexp(.@gid)), fnum(getguildnxp(.@gid))); + else + mesc l("Guild Lv @@, @@/@@ EXP to level up", getguildlvl(.@gid), fnum(getguildexp(.@gid)), "???"); + + // mesc l("The average player level is @@", getguildavg(.@gid)); + //mesc l("Your position on the guild: @@", getguildrole(.@gid, getcharid(3), true)); + mesc l("You are the guild's \"%s\", and you contribute with %02d%% EXP.", + getguildpostitle(.@gid, .@pos), + getguildpostax(.@gid, .@pos)); + //getguildpostitle(.@gid, .@pos) + + // I forgot a function to get player title and allow any guildmaster to change this + if (.@admin) + { + next; + do + { + gmaster(); + next; + mesc l("Do you want to do something else?"); + } while (askyesno() == ASK_YES); + } + close; + + function gmaster { + .@gid=getcharid(2); + mesn; + mesc l("Please select the Guild Position you want to change."); + menuint + l("Abort"), -1, + l("Guild Master"), GPOS_GUILDMASTER, + l("Vice Leader"), GPOS_VICELEADER, + l("Recruiter"), GPOS_RECRUITER, + l("Treasurer"), GPOS_TREASURER, + l("Normal Member"), GPOS_MEMBER, + l("Newbie"), GPOS_NEWBIE; + mes ""; + .@idx=0+@menuret; + if (.@idx < 0) + return; + mesc l("The guild's \"%s\" currently contribute with %02d%% EXP.", getguildpostitle(.@gid, .@pos), getguildpostax(.@gid, .@idx)); + mesc l("Please write how much in percent is EXP Tax for member (range: 0~50)"), 1; + input .@exptax; + if (.@exptax < 0 || .@exptax > 50) + return; + mesc l("Applying..."); + switch (.@idx) { + case GPOS_GUILDMASTER: + .@name$="GuildMaster"; + .@perm=GPERM_ALL; + break; + case GPOS_VICELEADER: + .@name$="ViceLeader"; + .@perm=GPERM_ALL; + break; + case GPOS_RECRUITER: + .@name$="Recruiter"; + .@perm=GPERM_INVITE; + break; + case GPOS_TREASURER: + .@name$="Treasurer"; + .@perm=0; + break; + case GPOS_MEMBER: + .@name$="Member"; + .@perm=0; + break; + case GPOS_NEWBIE: + .@name$="Newbie"; + .@perm=0; + break; + default: + .@name$="Position "+(.@idx+1); + .@perm=0; + break; + } + //debugmes "setguildrole(%d,%d,%d,%d,\"%s\")", .@gid, .@idx, .@perm, .@exptax, .@name$; + setguildrole(.@gid, .@idx, .@perm, .@exptax, .@name$); + mesc l("Done!"), 3; + return; + } + +OnInit: + .distance=1; + end; +} + diff --git a/npc/guilds/storage.txt b/npc/guilds/storage.txt new file mode 100644 index 0000000..2f8db6d --- /dev/null +++ b/npc/guilds/storage.txt @@ -0,0 +1,33 @@ +// Moubootaur Legends Script +// Author: +// Jesusalva +// Description: +// Guild Facility - Guild Storage + +guilds,33,28,0 script Guild Storage NPC_NO_SPRITE,{ + .@gid=getcharid(2); + if (.@gid < 1) + end; + if (getguildlvl(.@gid) < 2) + { + npctalkonce l("Your guild need to have at least level 2 to use storage feature."); + } + else + { + if (getguildrole(.@gid, getcharid(3)) > GPOS_MEMBER) + { + dispbottom l("Your position must be the one of a regular member or above."); + end; + } + if (guildopenstorage()) + { + npctalkonce l("Someone else is using the guild storage right now. Please wait."); + } + } + end; + +OnInit: + .distance=2; + end; +} + |