diff options
57 files changed, 216 insertions, 37 deletions
diff --git a/client-data b/client-data -Subproject 2d4241d0e1e715fb7f6bef15752c2a16fa35ff2 +Subproject 2fbfe721bd69d3ef30c9ee8f3caf7e178a434a7 diff --git a/tools b/tools -Subproject 22ce3fd72b46c4675d82fa4b35fa24b8f22bd2d +Subproject 6984735e4ee369544147c3458759d6863763ea0 diff --git a/world/map/db/const-quest.txt b/world/map/db/const-quest.txt index 6f3f7148..1bea162b 100644 --- a/world/map/db/const-quest.txt +++ b/world/map/db/const-quest.txt @@ -115,20 +115,20 @@ MFLAG_KNOWS_UNFOCUS_RECIPE 65536 // Has been told about unfocus by Luca. MFLAG_GOT_MANA_PEARL 131072 // Had enough magic exp to get the Mana Pearl. // Flags set in the FLAGS variable: -FLAG_HAS_BOWLER_BURNSDAY 1 // every year's poem at burns day, shannon gives you a bowler hat -FLAG_OPENED_UNDERGROUND 2 // this flag is a replacement for variable Open_Underground_Palace_Barrier, which was used only as bool -FLAG_GOT_NAEM_GLOVES 4 // this replaces Naem_Quest_Done, which was used as a bool variable -FLAG_GOT_GRADUATIONCAP 8 // this is a bit which was to be found in Tut_var second bit -FLAG_TOWEL_HELPED 16 // gave the towel npc the stuff he wants -FLAG_TOWEL_COMPLETED 32 // got the towel from the towel npc -FLAG_ANDRA_HELPED 64 // Knows Andra and agreed to help her -FLAG_ROSSI_COMPLETED 128 // Completed the Rossi Quest -FLAG_TUTORIAL_DONE 256 // player completed tutorial (or entered the tutorial area from outside after it was added) -FLAG_SNOWMAN 512 // player gave candy to the snowman -FLAG_SANTAS_HELPER 1024 // player gave presents to Santa's helper -FLAG_HURNSMINE_CHEST 2048 // player opened the chest with the short sword in Hurnscald mines -FLAG_GOT_BEANIEHAT 4096 // player got Beanie Copter Hat from Milly -FLAG_DECLINED_BEANIEHAT 8192 // player declined Beanie Copter Hat from Milly +FLAG_HAS_BOWLER_BURNSDAY 1 // every year's poem at burns day, shannon gives you a bowler hat +FLAG_OPENED_UNDERGROUND 2 // this flag is a replacement for variable Open_Underground_Palace_Barrier, which was used only as bool +FLAG_GOT_NAEM_GLOVES 4 // this replaces Naem_Quest_Done, which was used as a bool variable +FLAG_GOT_GRADUATIONCAP 8 // this is a bit which was to be found in Tut_var second bit +FLAG_TOWEL_HELPED 16 // gave the towel npc the stuff he wants +FLAG_TOWEL_COMPLETED 32 // got the towel from the towel npc +FLAG_ANDRA_HELPED 64 // Knows Andra and agreed to help her +FLAG_ROSSI_COMPLETED 128 // Completed the Rossi Quest +FLAG_TUTORIAL_DONE 256 // player completed tutorial (or entered the tutorial area from outside after it was added) +FLAG_SNOWMAN 512 // player gave candy to the snowman +FLAG_SANTAS_HELPER 1024 // player gave presents to Santa's helper +FLAG_HURNSMINE_CHEST 2048 // player opened the chest with the short sword in Hurnscald mines +FLAG_GOT_BEANIEHAT 4096 // player got Beanie Copter Hat from Milly +FLAG_DECLINED_BEANIEHAT 8192 // player declined Beanie Copter Hat from Milly //FLAG_ 16384 // not used at the moment //FLAG_ 32768 // not used at the moment FLAG_BEHEADER_MASK 65536 // traded with The Beheader @@ -141,6 +141,15 @@ FLAG_LUCA_FIX 4194304 // fixed a bug FLAG_XMAS21 8388608 // Christmas 2021 Rewards FLAG_KESHLAM_REPACKED 16777216 // Moved FLAG_KESHLAM_FLAWEDLENS (16384) and FLAG_KESHLAM_RAREDROP (32768) to KESHLAM_STATE +// Flags set in the HURNS1_STATE variable: +// Pink Petal Shop Quest is using bits 1-8 (BYTE_0_SHIFT, BYTE_0_MASK) +// Constants Related to Blossom +PINK_FLOWER_SEEDS_NEEDED 250 // 1-253 possible, PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS and PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS need to be adjusted to this +PINK_FLOWER_SEEDS_CHANCE 50 +PINK_PETAL_SHOP_ASKED_FOR_PETALS 1 // player asked Blossom if she sells petals +PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS 251 // player found the needed amount of Pink Flower Seeds +PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS 252 // player delivered the needed amount of Pink Flower Seeds + // Flags set in the KESHLAM_STATE variable: FLAG_KESHLAM_FLAWEDLENS 65536 // player got the Flawed Lens from Keshlam's Chest FLAG_KESHLAM_RAREDROP 131072 // player got the super rare from Keshlam's Chest diff --git a/world/map/db/item_db.conf b/world/map/db/item_db.conf index 9ee50411..afd04323 100644 --- a/world/map/db/item_db.conf +++ b/world/map/db/item_db.conf @@ -562,7 +562,6 @@ item_db: ( "> Script: <" bonus bDoubleAddRate, 50; - bonus bSpeedAddRate, 10; bonus bHit, -20; bonus bCritical, -25; //bonus bBaseWeaponDelayAdjust, 1150; // @TMWA @@ -5273,7 +5272,6 @@ item_db: ( noauction: true noselltonpc: true } - //Disabled: true // @TMWA }, { Id: 5296 diff --git a/world/map/db/item_db_generic.txt b/world/map/db/item_db_generic.txt index d9bc9567..13f24527 100644 --- a/world/map/db/item_db_generic.txt +++ b/world/map/db/item_db_generic.txt @@ -266,7 +266,7 @@ 5288, Naftalin, 3, 0, 0, 1, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, {}, {} 5292, SilverOre, 3, 1600, 800, 40, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, {}, {} //5293, CrystallizedDragonBlood,3, 0, 0, 1111, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} -//5295, PinkFlowerSeed, 3, 0, 0, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} +5295, PinkFlowerSeed, 3, 0, 0, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} //5296, SilverIngot, 3, 20000, 2200, 1000, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} 5297, GoldenTooth, 3, 20000, 2000, 40, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, {}, {} //5298, CloverDrawing, 3, 0, 0, 10, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 7, {}, {} diff --git a/world/map/db/item_db_weapon.txt b/world/map/db/item_db_weapon.txt index 2470204b..be6e511e 100644 --- a/world/map/db/item_db_weapon.txt +++ b/world/map/db/item_db_weapon.txt @@ -19,7 +19,7 @@ 573, Falchion, 4, 8000, 4000, 900, 270, 0, 1, 0, 0, 2, 2, 1, 1, 2, 0, {}, {callfunc "UnreleasedItem"; bonus bDoubleAddRate, 40; bonus bHit, -25; bonus bCritical, -25;} 574, ScorpionKing, 4, 8000, 4000, 600, 120, 0, 1, 0, 0, 2, 2, 1, 1, 4, 0, {}, {callfunc "UnreleasedItem";} 575, DesertBow, 4, 8000, 4000, 1200, 85, 0, 7, -10, 0, 2, 34, 1, 1, 11, 0, {}, {callfunc "UnreleasedItem"; set @LauncherType, AMMO_BOW; callfunc "CheckLauncher";} -576, Beheader, 4, 8000, 4000, 2000, 999, 0, 1, 0, 0, 2, 2, 1, 1, 2, 0, {}, {callfunc "NoBowItem"; set @bStat, Int; set @maxbStatVal, 1; callfunc "RequireMaxStat"; bonus bDoubleAddRate, 50; bonus bSpeedAddRate, 10; bonus bHit, -20; bonus bCritical, -25; bonus bBaseWeaponDelayAdjust, 1150;} +576, Beheader, 4, 8000, 4000, 2000, 999, 0, 1, 0, 0, 2, 2, 1, 1, 2, 0, {}, {callfunc "NoBowItem"; set @bStat, Int; set @maxbStatVal, 1; callfunc "RequireMaxStat"; bonus bDoubleAddRate, 50; bonus bHit, -20; bonus bCritical, -25; bonus bBaseWeaponDelayAdjust, 1150;} 577, BoneDarts, 4, 8000, 4000, 300, 100, 0, 3, 0, 0, 2, 2, 1, 1, 22, 0, {}, {callfunc "UnreleasedItem";} 578, SandCutter, 4, 30000, 15000, 1500, 160, 0, 1, 0, 0, 2, 2, 2, 80, 2, 0, {}, {bonus bDoubleAddRate, 5; bonus bHit, 3;} //ID, Name, Type, Price, Sell, Weight, ATK, DEF, Range, Mbonus, Slot, Gender, Loc, wLV, eLV, View, Mode, {UseScript}, {EquipScript} diff --git a/world/map/db/mob_skill_db.txt b/world/map/db/mob_skill_db.txt index 23d85820..82964f89 100644 --- a/world/map/db/mob_skill_db.txt +++ b/world/map/db/mob_skill_db.txt @@ -54,7 +54,6 @@ 1014,PinkFlower@NPC_SUMMONSLAVE,any,198,1,10000,1000,60000,no,self,slavelt,4,1049,0,0,0,0, 1095,WhiteBell@NPC_SUMMONSLAVE,any,198,1,10000,1000,60000,no,self,slavelt,4,1093,0,0,0,0, 1049,Bee@NPC_POISON,attack,178,20,1000,0,500,yes,target,always,0,0,10,0,0,0, -1049,Bee@NPC_SELFDESTRUCTION,attack,175,1,1000,0,500,yes,self,notintown,0,30,0,0,0,0, 1139,Virus@NPC_POISON,attack,178,50,1500,1000,600,yes,target,always,0,0,10,0,0,0, // The Lost Abilities 1073,TheLost@NPC_SUMMONSLAVE_DMUSHX2X,any,198,1,8000,1000,5000,no,self,slavelt,2,1106,0,0,0,0, diff --git a/world/map/db/params.txt b/world/map/db/params.txt index db5a846c..d600b4ad 100644 --- a/world/map/db/params.txt +++ b/world/map/db/params.txt @@ -49,6 +49,12 @@ Vit2 63 1 Int2 64 1 Dex2 65 1 Luk2 66 1 +// activity +KILLS 490 1 +CASTS 491 1 +ITEMS_USED 492 1 +TILES_WALKED 493 1 +ATTACKS 494 1 GM 500 1 ATTACKRANGE 1000 1 ELTLVL 1001 1 diff --git a/world/map/npc/012-1/shops.txt b/world/map/npc/012-1/shops.txt index 3620b2c9..fe4a8ac5 100644 --- a/world/map/npc/012-1/shops.txt +++ b/world/map/npc/012-1/shops.txt @@ -1,20 +1,62 @@ // 012-1,36,99,0|shop|#FlowerShop|32767,RedRose:*1,PinkRose:*1,YellowRose:*1,WhiteRose:*1,OrangeRose:*1,DarkRedRose:*1,RedTulip:*1,PinkTulip:*1,YellowTulip:*1,WhiteTulip:*1,OrangeTulip:*1 +012-1,36,99,0|shop|#FlowerPetalShop|32767,PinkPetal:*1,RedRose:*1,PinkRose:*1,YellowRose:*1,WhiteRose:*1,OrangeRose:*1,DarkRedRose:*1,RedTulip:*1,PinkTulip:*1,YellowTulip:*1,WhiteTulip:*1,OrangeTulip:*1 012-1,36,99,0|script|Blossom|163 { + goto L_Start; + +L_Start: + set @shopopt$, ""; + if ( (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_ASKED_FOR_PETALS ) set @shopopt$, "Do you sell Pink Petals?"; + if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_ASKED_FOR_PETALS && (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) set @shopopt$, "How many Pink Flower Seeds do I need again?"; + if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) set @shopopt$, "I want to deliver the Pink Flower Seeds."; + mes "[Blossom]"; mes "\"Hello, would you like to buy some flowers?\""; menu "Sure.", L_Shop, "Not right now.", L_Close, - "Can I trade this Rose Hat for a differently colored one?", L_RoseHat; + "Can I trade this Rose Hat for a differently colored one?", L_RoseHat, + @shopopt$, L_Petals; L_Shop: + if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS ) goto L_ShopPetals; close2; shop "#FlowerShop"; +L_ShopPetals: + close2; + shop "#FlowerPetalShop"; + +L_Petals: + if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_ASKED_FOR_PETALS && (HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) goto L_HowMany; + if ( (HURNS1_STATE & BYTE_0_MASK) == PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS ) goto L_Deliver; + + set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | PINK_PETAL_SHOP_ASKED_FOR_PETALS; + + mes "[Blossom]"; + mes "\"Not at the moment but I could grow some if you bring me " + PINK_FLOWER_SEEDS_NEEDED + " [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].\""; + goto L_Close; + +L_HowMany: + mes "[Blossom]"; + mes "\"You need " + PINK_FLOWER_SEEDS_NEEDED + " [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@].\""; + goto L_Close; + +L_Deliver: + if ( countitem(PinkFlowerSeed) < PINK_FLOWER_SEEDS_NEEDED ) goto L_HowMany; + + set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | PINK_PETAL_SHOP_DELIVERED_FLOWER_SEEDS; + delitem PinkFlowerSeed, PINK_FLOWER_SEEDS_NEEDED; + + mes "[Blossom]"; + mes "\"Wonderful you found all the [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@]."; + mes "I found some myself while you where away and so I already have some [@@" + PinkPetal +"|Pink Petals@@] on stock since that flowers grow real fast."; + mes "But with all your seeds I can establish a liftime supply for you now.\""; + goto L_Close; + L_RoseHat: set @base_id, 897; mes "[Blossom]"; diff --git a/world/map/npc/items/underworld_troll.txt b/world/map/npc/items/underworld_troll.txt index afa22f6f..6a9d8740 100644 --- a/world/map/npc/items/underworld_troll.txt +++ b/world/map/npc/items/underworld_troll.txt @@ -1,6 +1,6 @@ function|script|UnderworldTroll { - if (getequipid(equip_hand1) != KidBook) goto L_Return; + if (getequipid(equip_hand1) != KidBook) && (getequipid(equip_hand1) != FloydBook) goto L_Return; bonus bStr, 10; bonus bAtkRange, 1; goto L_Return; diff --git a/world/map/npc/magic/event-summon-managuardian.txt b/world/map/npc/magic/event-summon-managuardian.txt index 79df2efa..e66c3eb7 100644 --- a/world/map/npc/magic/event-summon-managuardian.txt +++ b/world/map/npc/magic/event-summon-managuardian.txt @@ -22,6 +22,8 @@ L_Pay: sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 100; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/event-summon-manatyrant.txt b/world/map/npc/magic/event-summon-manatyrant.txt index bb36d415..bf2634c5 100644 --- a/world/map/npc/magic/event-summon-manatyrant.txt +++ b/world/map/npc/magic/event-summon-manatyrant.txt @@ -21,6 +21,8 @@ L_Pay: sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 100; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level0-antiprotect.txt b/world/map/npc/magic/level0-antiprotect.txt index 129d3c62..47106f74 100644 --- a/world/map/npc/magic/level0-antiprotect.txt +++ b/world/map/npc/magic/level0-antiprotect.txt @@ -1,6 +1,8 @@ -|script|antiprotect|32767 { if(call("magic_checks", 1)) end; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow callfunc "magic_exp"; if (@antiprotect) diff --git a/world/map/npc/magic/level0-discharge.txt b/world/map/npc/magic/level0-discharge.txt index 7b2cfa8c..17d1da76 100644 --- a/world/map/npc/magic/level0-discharge.txt +++ b/world/map/npc/magic/level0-discharge.txt @@ -1,6 +1,8 @@ -|script|discharge spell|32767 { if(call("magic_checks")) end; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow callfunc "magic_exp"; // tell the spells they were discharged diff --git a/world/map/npc/magic/level0-wand.txt b/world/map/npc/magic/level0-wand.txt index 7a0f6c25..efb49ba8 100644 --- a/world/map/npc/magic/level0-wand.txt +++ b/world/map/npc/magic/level0-wand.txt @@ -10,6 +10,8 @@ set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 500, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 500, 0, BL_ID; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_WAND_CAST, strcharinfo(0); callfunc "magic_exp"; diff --git a/world/map/npc/magic/level1-aggravate.txt b/world/map/npc/magic/level1-aggravate.txt index 97ae4151..05eee811 100644 --- a/world/map/npc/magic/level1-aggravate.txt +++ b/world/map/npc/magic/level1-aggravate.txt @@ -9,6 +9,8 @@ set @args$, ""; callfunc "adjust_spellpower"; // we reset @args$ because this spell should not have a target set @distance, (2 + (@spellpower / 50)); set Sp, Sp - 3; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_AGGRAVATE_CAST, strcharinfo(0); callfunc "magic_exp"; foreach 2, getmap(), (POS_X - @distance), (POS_Y - @distance), (POS_X + @distance), (POS_Y + @distance), strnpcinfo(0) + "::OnMob"; diff --git a/world/map/npc/magic/level1-detect-magic.txt b/world/map/npc/magic/level1-detect-magic.txt index bfe320a4..33597d02 100644 --- a/world/map/npc/magic/level1-detect-magic.txt +++ b/world/map/npc/magic/level1-detect-magic.txt @@ -8,6 +8,8 @@ sc_start SC_COOLDOWN, 6000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 3; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_DETECT_CAST, strcharinfo(0); set .@range, (@spellpower/50)+1; foreach 1, getmap(), POS_X - .@range, POS_Y - .@range, POS_X + .@range, POS_Y + .@range, diff --git a/world/map/npc/magic/level1-experience.txt b/world/map/npc/magic/level1-experience.txt index 76d6b888..bfd73378 100644 --- a/world/map/npc/magic/level1-experience.txt +++ b/world/map/npc/magic/level1-experience.txt @@ -14,6 +14,8 @@ if (@level < .level) end; callfunc "adjust_spellpower"; set Sp, Sp - 1; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_EXP_CAST, strcharinfo(0); callfunc "magic_exp"; set @ratio, ((@last_exp*10) - rand(.MAX_MAGIC_EXP[@level]/30))/.MAX_MAGIC_EXP[@level]; diff --git a/world/map/npc/magic/level1-flare-dart.txt b/world/map/npc/magic/level1-flare-dart.txt index d7d387cd..66a3a24b 100644 --- a/world/map/npc/magic/level1-flare-dart.txt +++ b/world/map/npc/magic/level1-flare-dart.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 10; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_DART_CAST, strcharinfo(0); setarray @flarspell[0], sqrt(@spellpower) * 5, //dmg diff --git a/world/map/npc/magic/level1-grow-alizarin.txt b/world/map/npc/magic/level1-grow-alizarin.txt index 4169c729..d82288cd 100644 --- a/world/map/npc/magic/level1-grow-alizarin.txt +++ b/world/map/npc/magic/level1-grow-alizarin.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); setarray @summon[0], 0, (getskilllv(.school)/2)+1; callfunc "magic_exp"; diff --git a/world/map/npc/magic/level1-grow-cobalt.txt b/world/map/npc/magic/level1-grow-cobalt.txt index e50cfb39..58028e8c 100644 --- a/world/map/npc/magic/level1-grow-cobalt.txt +++ b/world/map/npc/magic/level1-grow-cobalt.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); setarray @summon[0], 0, (getskilllv(.school)/2)+1; callfunc "magic_exp"; diff --git a/world/map/npc/magic/level1-grow-gamboge.txt b/world/map/npc/magic/level1-grow-gamboge.txt index cb7f6221..fae2cf7d 100644 --- a/world/map/npc/magic/level1-grow-gamboge.txt +++ b/world/map/npc/magic/level1-grow-gamboge.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); setarray @summon[0], 0, (getskilllv(.school)/2)+1; callfunc "magic_exp"; diff --git a/world/map/npc/magic/level1-grow-mauve.txt b/world/map/npc/magic/level1-grow-mauve.txt index f90b3b89..af8f54d8 100644 --- a/world/map/npc/magic/level1-grow-mauve.txt +++ b/world/map/npc/magic/level1-grow-mauve.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 2000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_GROW_CAST, strcharinfo(0); setarray @summon[0], 0, (getskilllv(.school)/2)+1; callfunc "magic_exp"; diff --git a/world/map/npc/magic/level1-lesser-heal.txt b/world/map/npc/magic/level1-lesser-heal.txt index 051445fb..0c124ff3 100644 --- a/world/map/npc/magic/level1-lesser-heal.txt +++ b/world/map/npc/magic/level1-lesser-heal.txt @@ -22,6 +22,8 @@ L_Pay: delitem "Lifestone", 1; callfunc "adjust_spellpower"; set Sp, Sp - 6; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_HEAL_CAST, strcharinfo(0); callfunc "magic_exp"; if (@target_id != BL_ID) goto L_NotMe; diff --git a/world/map/npc/magic/level1-magic-blade.txt b/world/map/npc/magic/level1-magic-blade.txt index 91ff5967..53ab8572 100644 --- a/world/map/npc/magic/level1-magic-blade.txt +++ b/world/map/npc/magic/level1-magic-blade.txt @@ -13,6 +13,8 @@ sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 9; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_BLADE_CAST, strcharinfo(0); setarray @chizaspell[0], if_then_else(.@component$ == "Knife", 40, 60), // dmg diff --git a/world/map/npc/magic/level1-make-sulphur.txt b/world/map/npc/magic/level1-make-sulphur.txt index fa728106..4371ba6a 100644 --- a/world/map/npc/magic/level1-make-sulphur.txt +++ b/world/map/npc/magic/level1-make-sulphur.txt @@ -9,6 +9,8 @@ sc_start SC_COOLDOWN, 4000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 4; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SULPHUR_CAST, strcharinfo(0); setarray @create_params[0], (@spellpower/100)+1+(rand(max(1,(800-@spellpower)))/180), 50; setarray @create_items$[0], "SulphurPowder", "PileOfAsh"; diff --git a/world/map/npc/magic/level1-sense-spouse.txt b/world/map/npc/magic/level1-sense-spouse.txt index fe95c094..607847f3 100644 --- a/world/map/npc/magic/level1-sense-spouse.txt +++ b/world/map/npc/magic/level1-sense-spouse.txt @@ -1,6 +1,8 @@ -|script|sense-spouse|32767 { set .@m, getpartnerid2(); + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow if (.@m < 1) goto L_NotMarried; if (isloggedin(.@m) < 1) diff --git a/world/map/npc/magic/level1-summon-maggots.txt b/world/map/npc/magic/level1-summon-maggots.txt index a70ab869..8700e39a 100644 --- a/world/map/npc/magic/level1-summon-maggots.txt +++ b/world/map/npc/magic/level1-summon-maggots.txt @@ -19,6 +19,8 @@ L_Pay: sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 21; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_MAGGOT_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level1-transmute-wood.txt b/world/map/npc/magic/level1-transmute-wood.txt index 2bb07251..f60b35da 100644 --- a/world/map/npc/magic/level1-transmute-wood.txt +++ b/world/map/npc/magic/level1-transmute-wood.txt @@ -9,6 +9,8 @@ sc_start SC_COOLDOWN, 4000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 5; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_WOOD_CAST, strcharinfo(0); if (@args$ == "boo") goto L_Mouboo; elif (@args$ == "lurk") goto L_Skytlurk; diff --git a/world/map/npc/magic/level2-arrow-hail.txt b/world/map/npc/magic/level2-arrow-hail.txt index 6b6c78b9..90d3e9fc 100644 --- a/world/map/npc/magic/level2-arrow-hail.txt +++ b/world/map/npc/magic/level2-arrow-hail.txt @@ -25,6 +25,8 @@ L_Pay: else delitem "IronArrow", 20; delitem "SulphurPowder", 1; set Sp, Sp - 25; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 5000, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 5000, 0, BL_ID; diff --git a/world/map/npc/magic/level2-barrier.txt b/world/map/npc/magic/level2-barrier.txt index 2c170ae4..77eb5ae5 100644 --- a/world/map/npc/magic/level2-barrier.txt +++ b/world/map/npc/magic/level2-barrier.txt @@ -24,10 +24,12 @@ L_Pay: addtimer 1000, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 1000, 0, BL_ID; set Sp, Sp - 15; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_BARRIER_CAST, strcharinfo(0); callfunc "magic_exp"; if (BL_ID != @target_id) misceffect FX_MAGIC_BARRIER_HIT, @args$; - set .@asorm_time, (@spellpower*200)+2000; + set .@asorm_time, (@spellpower*777)+2023; sc_start SC_MBARRIER, .@asorm_time, max(30,(@spellpower/8))+20, @target_id; message @args$, "Barrier : You are surrounded by a magical barrier."; set @asorm_future, gettimetick(0) + .@asorm_time - 100, @target_id; diff --git a/world/map/npc/magic/level2-detect-players.txt b/world/map/npc/magic/level2-detect-players.txt index 828733a4..0fd57a1c 100644 --- a/world/map/npc/magic/level2-detect-players.txt +++ b/world/map/npc/magic/level2-detect-players.txt @@ -8,6 +8,8 @@ sc_start SC_COOLDOWN, 300, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 7; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_WHO_CAST, strcharinfo(0); callfunc "magic_exp"; set @inwilt$, ""; diff --git a/world/map/npc/magic/level2-enchant-lifestone.txt b/world/map/npc/magic/level2-enchant-lifestone.txt index 178bf18c..a03e645b 100644 --- a/world/map/npc/magic/level2-enchant-lifestone.txt +++ b/world/map/npc/magic/level2-enchant-lifestone.txt @@ -22,6 +22,8 @@ L_Proceed: sc_start SC_COOLDOWN, 4000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 15; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_STONE_CAST, strcharinfo(0); getitem "Lifestone", 1; callfunc "magic_exp"; diff --git a/world/map/npc/magic/level2-flying-backpack.txt b/world/map/npc/magic/level2-flying-backpack.txt index c6d3c461..994e4084 100644 --- a/world/map/npc/magic/level2-flying-backpack.txt +++ b/world/map/npc/magic/level2-flying-backpack.txt @@ -23,6 +23,8 @@ L_Pay: addtimer 1000, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 1000, 0, BL_ID; set Sp, Sp - 12; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_FLYING_CAST, strcharinfo(0); callfunc "magic_exp"; if (BL_ID != @target_id) misceffect FX_MAGIC_FLYING_HIT, @args$; diff --git a/world/map/npc/magic/level2-happy-curse.txt b/world/map/npc/magic/level2-happy-curse.txt index 55516541..aa7be828 100644 --- a/world/map/npc/magic/level2-happy-curse.txt +++ b/world/map/npc/magic/level2-happy-curse.txt @@ -13,6 +13,8 @@ sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 13; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_JOY_CAST, strcharinfo(0); callfunc "magic_exp"; diff --git a/world/map/npc/magic/level2-hide.txt b/world/map/npc/magic/level2-hide.txt index 6f78f1cf..1274f7a2 100644 --- a/world/map/npc/magic/level2-hide.txt +++ b/world/map/npc/magic/level2-hide.txt @@ -16,6 +16,8 @@ sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 11; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_HIDE_CAST, strcharinfo(0); callfunc "magic_exp"; diff --git a/world/map/npc/magic/level2-lay-on-hands.txt b/world/map/npc/magic/level2-lay-on-hands.txt index 8feb9107..1270dfb2 100644 --- a/world/map/npc/magic/level2-lay-on-hands.txt +++ b/world/map/npc/magic/level2-lay-on-hands.txt @@ -24,6 +24,8 @@ L_Pay: addtimer 500, "Magic Timer::OnClear"; // XXX should this be 0 ? sc_start SC_COOLDOWN, 500, 0, BL_ID; set Sp, Sp - 10; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_LAY_CAST, strcharinfo(0); // on caster misceffect FX_MAGIC_LAY_HIT, @args$; // on target diff --git a/world/map/npc/magic/level2-lightning-strike.txt b/world/map/npc/magic/level2-lightning-strike.txt index ce89652c..bdd311a6 100644 --- a/world/map/npc/magic/level2-lightning-strike.txt +++ b/world/map/npc/magic/level2-lightning-strike.txt @@ -12,6 +12,8 @@ sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 20; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_BOLT_CAST, strcharinfo(0); setarray @ingravspell[0], @spellpower, diff --git a/world/map/npc/magic/level2-magic-knuckles.txt b/world/map/npc/magic/level2-magic-knuckles.txt index c16485bb..d674c621 100644 --- a/world/map/npc/magic/level2-magic-knuckles.txt +++ b/world/map/npc/magic/level2-magic-knuckles.txt @@ -14,13 +14,15 @@ sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 20; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow set .caster, getcharid(3); misceffect FX_MAGIC_KNUCKLE_CAST, strcharinfo(0); setarray @upmarmuspell[0], - max(1, BASE_ATK - 100 + min(100, (Int+Int2))), // dmg + max(1, BASE_ATK - 100 + min(100, (Int+Int2) * 2)), // dmg ((@spellpower/10) + (((Dex+Dex2) * 8)/(sqrt(BaseLevel + 34)) + 20)), // charges (you get more at lower levels) - (sqrt(300 - ((Agi+Agi2) * 2)) + (5/2)), // delay - (((Agi+Agi2) + (Int+Int2)) * 2 / 5), // dmg bonus + (sqrt((300 - ((Agi+Agi2) * 2)) + (5/2) * 4)), // delay + (((Agi+Agi2) + (Int+Int2)) / 5), // dmg bonus (((BaseLevel/5) + Str) * 2); // do not allow to equip light armor, cast, and then switch to heavy armor to get bonus str callfunc "magic_exp"; goto L_FreeRecast; diff --git a/world/map/npc/magic/level2-make-arrows.txt b/world/map/npc/magic/level2-make-arrows.txt index dbd2bc2f..ad362548 100644 --- a/world/map/npc/magic/level2-make-arrows.txt +++ b/world/map/npc/magic/level2-make-arrows.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 8; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_ARROW_CAST, strcharinfo(0); setarray @create_params[0], (@spellpower/32)+1+(rand(max(1,(800-@spellpower)))/80), 500; setarray @create_items$[0], "IronArrow", "WarpedLog"; diff --git a/world/map/npc/magic/level2-make-bones.txt b/world/map/npc/magic/level2-make-bones.txt index 2cc3f922..bc9bc6e5 100644 --- a/world/map/npc/magic/level2-make-bones.txt +++ b/world/map/npc/magic/level2-make-bones.txt @@ -22,6 +22,8 @@ L_Resume: sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 16; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_ARROW_CAST, strcharinfo(0); setarray @create_params[0], (@spellpower/32)+1+(rand(max(1,(800-@spellpower)))/80), 500; setarray @create_items$[0], "BoneArrows", "IronArrow"; diff --git a/world/map/npc/magic/level2-make-iron-powder.txt b/world/map/npc/magic/level2-make-iron-powder.txt index 6181be8d..0723e1ff 100644 --- a/world/map/npc/magic/level2-make-iron-powder.txt +++ b/world/map/npc/magic/level2-make-iron-powder.txt @@ -11,6 +11,8 @@ sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 8; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_IRONP_CAST, strcharinfo(0); setarray @create_params[0], (@spellpower/140)+1+(rand(max(1,(900-@spellpower)))/220), 700; setarray @create_items$[0], "IronPowder", "IronOre"; diff --git a/world/map/npc/magic/level2-make-shirt.txt b/world/map/npc/magic/level2-make-shirt.txt index dd42f79a..ac2c0437 100644 --- a/world/map/npc/magic/level2-make-shirt.txt +++ b/world/map/npc/magic/level2-make-shirt.txt @@ -9,6 +9,8 @@ sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 25; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SHIRT_CAST, strcharinfo(0); setarray @create_params[0], 1, 425; setarray @create_items$[0], "CottonShirt", "CottonCloth"; diff --git a/world/map/npc/magic/level2-make-short-tanktop.txt b/world/map/npc/magic/level2-make-short-tanktop.txt index 0fd5d6d3..dc6c1fb8 100644 --- a/world/map/npc/magic/level2-make-short-tanktop.txt +++ b/world/map/npc/magic/level2-make-short-tanktop.txt @@ -9,6 +9,8 @@ sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 25; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SHIRT_CAST, strcharinfo(0); setarray @create_params[0], 1, 250; setarray @create_items$[0], "ShortTankTop", "CottonCloth"; diff --git a/world/map/npc/magic/level2-make-tanktop.txt b/world/map/npc/magic/level2-make-tanktop.txt index a416e7a0..112bafdc 100644 --- a/world/map/npc/magic/level2-make-tanktop.txt +++ b/world/map/npc/magic/level2-make-tanktop.txt @@ -9,6 +9,8 @@ sc_start SC_COOLDOWN, 5000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 25; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SHIRT_CAST, strcharinfo(0); setarray @create_params[0], 1, 350; setarray @create_items$[0], "TankTop", "CottonCloth"; diff --git a/world/map/npc/magic/level2-protect.txt b/world/map/npc/magic/level2-protect.txt index 25cb7c50..7abc9a1a 100644 --- a/world/map/npc/magic/level2-protect.txt +++ b/world/map/npc/magic/level2-protect.txt @@ -25,6 +25,8 @@ L_Pay: addtimer 1500, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 1500, 0, BL_ID; set Sp, Sp - 14; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SHIELD_CAST, strcharinfo(0); callfunc "magic_exp"; misceffect FX_MAGIC_SHIELD, @args$; diff --git a/world/map/npc/magic/level2-rain.txt b/world/map/npc/magic/level2-rain.txt index 89ded96d..6a7f288b 100644 --- a/world/map/npc/magic/level2-rain.txt +++ b/world/map/npc/magic/level2-rain.txt @@ -18,6 +18,8 @@ OnCast: L_Pay: if (getskilllv(.school) < 4) delitem "BottleOfWater", 1; set Sp, Sp - 17; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow set @_M_BLOCK, 1; // block casting, until the timer clears it addtimer 3000, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 3000, 0, BL_ID; diff --git a/world/map/npc/magic/level2-shear.txt b/world/map/npc/magic/level2-shear.txt index c6141a1c..8f259bd3 100644 --- a/world/map/npc/magic/level2-shear.txt +++ b/world/map/npc/magic/level2-shear.txt @@ -9,6 +9,8 @@ sc_start SC_COOLDOWN, 1000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 23; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SHEAR_CAST, strcharinfo(0); setarray @chipchipspell[0], @spellpower, diff --git a/world/map/npc/magic/level2-summon-fluffies.txt b/world/map/npc/magic/level2-summon-fluffies.txt index d232b96e..f10a86b5 100644 --- a/world/map/npc/magic/level2-summon-fluffies.txt +++ b/world/map/npc/magic/level2-summon-fluffies.txt @@ -20,6 +20,8 @@ L_Pay: sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 39; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_FLUFFY_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level2-summon-mouboo.txt b/world/map/npc/magic/level2-summon-mouboo.txt index 5b5887e7..c692e9cf 100644 --- a/world/map/npc/magic/level2-summon-mouboo.txt +++ b/world/map/npc/magic/level2-summon-mouboo.txt @@ -20,6 +20,8 @@ L_Pay: sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 35; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_MOUBOO_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level2-summon-pinkie.txt b/world/map/npc/magic/level2-summon-pinkie.txt index e788382d..61af9eed 100644 --- a/world/map/npc/magic/level2-summon-pinkie.txt +++ b/world/map/npc/magic/level2-summon-pinkie.txt @@ -20,6 +20,8 @@ L_Pay: sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 35; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_PINKY_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level2-summon-snakes.txt b/world/map/npc/magic/level2-summon-snakes.txt index db0d0b6c..0723961b 100644 --- a/world/map/npc/magic/level2-summon-snakes.txt +++ b/world/map/npc/magic/level2-summon-snakes.txt @@ -21,6 +21,8 @@ L_Pay: sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 40; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SNAKE_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level2-summon-spiky-mushroom.txt b/world/map/npc/magic/level2-summon-spiky-mushroom.txt index 1edab6f4..701648d5 100644 --- a/world/map/npc/magic/level2-summon-spiky-mushroom.txt +++ b/world/map/npc/magic/level2-summon-spiky-mushroom.txt @@ -20,6 +20,8 @@ L_Pay: sc_start SC_COOLDOWN, 20000, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 33; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_SPIKY_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; diff --git a/world/map/npc/magic/level2-summon-wickedmushroom.txt b/world/map/npc/magic/level2-summon-wickedmushroom.txt index eced8c3a..014a5d80 100644 --- a/world/map/npc/magic/level2-summon-wickedmushroom.txt +++ b/world/map/npc/magic/level2-summon-wickedmushroom.txt @@ -4,7 +4,7 @@ OnCast: if(call("magic_checks")) end; - if (Sp < 35) end; + if (Sp < 42) end; if (getmapflag(getmap(), MF_TOWN)) end; if (getskilllv(SKILL_MAGIC) < .level) end; if (getskilllv(.school) < .level) end; @@ -20,15 +20,17 @@ L_Pay: addtimer 15000, "Magic Timer::OnClear"; // set the new debuff sc_start SC_COOLDOWN, 15000, 0, BL_ID; callfunc "adjust_spellpower"; - set Sp, Sp - 35; + set Sp, Sp - 42; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_WICKED_CAST, strcharinfo(0); callfunc "magic_exp"; set .@puppet$, "#"+strnpcinfo(0)+"#"+BL_ID; set .@puppet, puppet(getmap(), POS_X, POS_Y, .@puppet$, 127); if (.@puppet < 1) end; - set .count, (@spellpower/250)+1, .@puppet; + set .count, (@spellpower/180)+1, .@puppet; set .master, BL_ID, .@puppet; - set .lifetime, @spellpower*80, .@puppet; + set .lifetime, @spellpower*300, .@puppet; addnpctimer 4000-(@spellpower*9), .@puppet$+"::OnSummon"; addnpctimer 6000, .@puppet$+"::OnDestroy"; end; diff --git a/world/map/npc/magic/level2-toxic-dart.txt b/world/map/npc/magic/level2-toxic-dart.txt index ef621cbb..a74ab475 100644 --- a/world/map/npc/magic/level2-toxic-dart.txt +++ b/world/map/npc/magic/level2-toxic-dart.txt @@ -12,6 +12,8 @@ sc_start SC_COOLDOWN, 500, 0, BL_ID; callfunc "adjust_spellpower"; set Sp, Sp - 15; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_TDART_CAST, strcharinfo(0); setarray @phlexspell[0], (sqrt(@spellpower) * 5), // elt damage diff --git a/world/map/npc/magic/level3-necromancy.txt b/world/map/npc/magic/level3-necromancy.txt index 48dc1ebf..416b8af5 100644 --- a/world/map/npc/magic/level3-necromancy.txt +++ b/world/map/npc/magic/level3-necromancy.txt @@ -20,6 +20,8 @@ addtimer 20000, "Magic Timer::OnClear"; sc_start SC_COOLDOWN, 20000, 0, BL_ID; set Sp, Sp - 50; + set CASTS, CASTS + 1; + if (CASTS < 0) set CASTS, 1; // overflow misceffect FX_MAGIC_DARKRED, strcharinfo(0); // on caster misceffect FX_PENTAGRAM_BUILDUP, @args$; // on target diff --git a/world/map/npc/mobs/mob_kill_handler.txt b/world/map/npc/mobs/mob_kill_handler.txt index 5542dcdb..069c01f4 100644 --- a/world/map/npc/mobs/mob_kill_handler.txt +++ b/world/map/npc/mobs/mob_kill_handler.txt @@ -5,7 +5,8 @@ OnInit: setarray $@QuestMobs, Maggot, Scorpion, RedScorpion, BlackScorpion, Pinkie, Fluffy, EasterFluffy, Mouboo, Squirrel, TameScorpion, HouseMaggot, AngryScorpion, - Terranite, Yeti, Reinboo, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar, Santaboo, Pollett; + Terranite, Yeti, Reinboo, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar, Santaboo, Pollett, PinkFlower; + setarray $@NatureKarmaGood, Scorpion, RedScorpion, BlackScorpion, AngryScorpion, DemonicMouboo, ViciousSquirrel, WickedMushroom, Bluepar; setarray $@NatureKarmaBad, Pinkie, Fluffy, EasterFluffy, Mouboo, Squirrel, Reinboo, Santaboo, Pollett; setarray $@NatureKarmaBadVal, 3, 3, 3, 4, 2, 3, 3, 3; @@ -22,11 +23,11 @@ function|script|MobKillHandler callfunc "ValonCount"; if (((QL_VALON >= 2) && (QL_VALON < 6)) && (@mobID == $@ValonMob[@valon_mob])) goto L_ValonMobKill; - goto L_NatureKarma; + goto L_NatureKarma; // no return here since NatureKarma shares a mob with Valon L_ValonMobKill: callfunc "AddValonCntMask"; - goto L_NatureKarma; + goto L_NatureKarma; // no return here since NatureKarma shares a mob with Valon L_NatureKarma: set .@find, array_search(@mobID, $@NatureKarmaGood); @@ -40,27 +41,59 @@ L_NatureKarma: L_Bad: set @value, $@NatureKarmaBadVal[.@find]; callfunc "QuestSagathaAnnoy"; - goto L_Celestia; + goto L_Return; L_Good: set @value, 1; callfunc "QuestSagathaHappy"; - goto L_Celestia; + goto L_Return; L_Celestia: - if (QL_CELESTIA < 5 || QL_CELESTIA >= 205 || @mobID != Yeti) goto L_Terranite; + if ( @mobID != Yeti ) goto L_Terranite; + if (QL_CELESTIA < 5 || QL_CELESTIA >= 205) goto L_Return; set QL_CELESTIA, QL_CELESTIA + 1; if (QL_CELESTIA == 205) message strcharinfo(0), "Yeti : ##3This should be enough yetis killed to please Celestia."; - goto L_Terranite; + goto L_Return; L_Terranite: - if (TERRAC < 1 || TERRAC > 1500 || @mobID != Terranite) goto L_Return; + if ( @mobID != Terranite ) goto L_Pink_Flower; + if (TERRAC < 1 || TERRAC > 1500) goto L_Return; if (TERRAC % 100 == 0) message strcharinfo(0), "Terranite : ##3Total Terranites Slain: "+TERRAC; set TERRAC, TERRAC + 1; goto L_Return; +L_Pink_Flower: + if ( @mobID != PinkFlower ) goto L_Return; // next mob label here + if ( ((HURNS1_STATE & BYTE_0_MASK) < PINK_PETAL_SHOP_ASKED_FOR_PETALS) || ((HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS) ) + goto L_Return; + + if (rand(PINK_FLOWER_SEEDS_CHANCE) < 1) goto L_Get_Seed; + goto L_Return; + +L_Get_Seed: + getinventorylist; + set .@free_slots, (100 - @inventorylist_count); + if (countitem(PinkFlowerSeed) >= 1 && countitem(PinkFlowerSeed) < 30000 ) + set .@free_slots, .@free_slots + 1; + if (.@free_slots < 1 || checkweight(PinkFlowerSeed, 1) == 0) + goto L_Pink_Flower_Seeds_Inv_Full; + + set HURNS1_STATE, (HURNS1_STATE & ~BYTE_0_MASK) | ((HURNS1_STATE & BYTE_0_MASK) + 1); + getitem PinkFlowerSeed, 1; + if ( (HURNS1_STATE & BYTE_0_MASK) >= PINK_PETAL_SHOP_FOUND_FLOWER_SEEDS) + goto L_Pink_Flower_Seeds_Full; + goto L_Return; + +L_Pink_Flower_Seeds_Full: + message strcharinfo(0), "Pink Flower : ##3You found enough [@@"+ PinkFlowerSeed + "|Pink Flower Seeds@@] for Blossom."; + goto L_Return; + +L_Pink_Flower_Seeds_Inv_Full: + message strcharinfo(0), "Pink Flower : ##3Your Inventory is full you can't pickup the [@@"+ PinkFlowerSeed + "|@@]."; + goto L_Return; + L_Return: return; } |