From cf18ce071c79ae37e14ea38943e0b1d88da70a7b Mon Sep 17 00:00:00 2001 From: Jesusaves Date: Fri, 9 Apr 2021 13:33:57 -0300 Subject: Override --- npc/magic/level2-shear.txt | 67 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100755 npc/magic/level2-shear.txt (limited to 'npc/magic/level2-shear.txt') diff --git a/npc/magic/level2-shear.txt b/npc/magic/level2-shear.txt new file mode 100755 index 00000000..79021013 --- /dev/null +++ b/npc/magic/level2-shear.txt @@ -0,0 +1,67 @@ +- script shear NPC32767,{ + if(call("magic_checks")) end; + if (Sp < 23) end; + if (getskilllv(SKILL_MAGIC) < .level) end; + if (getskilllv(.school) < .level) end; + set @_M_BLOCK, 1; // block casting, until the timer clears it + addtimer 1000, "Magic Timer::OnClear"; // set the new debuff + callfunc "adjust_spellpower"; + Sp = Sp - 23; + misceffect FX_MAGIC_GREEN, strcharinfo(0); + setarray @chipchipspell[0], + @spellpower, + (((200 - Agi) * 2000) / 200); //delay + callfunc "magic_exp"; + goto L_FreeRecast; + +OnAttack: + if (isloggedin(@target_id)) goto L_FreeRecast; // can not shear a player + if (sc_check(SC_SHEARED, @target_id)) goto L_FreeRecast; // mob already sheared + if (target(BL_ID, @target_id, 22) != 22) goto L_FreeRecast; // 0x10 | 0x02 | 0x04 + sc_start SC_SHEARED, 600000, 0, @target_id; + .@score = rand(1000 - rand(@chipchipspell[0])); + set .@id, get(Class, @target_id); // get the mob ID + @chipchipspell[2] = 0; + + if (.@id == 1020 && .@score < 300) set .@item$, "WhiteFur"; // Fluffy + elif (.@id == 1027 && .@score < 300) set .@item$, "WhiteFur"; // EasterFluffy + elif (.@id == 1019 && .@score < 250) set .@item$, "HardSpike"; // SpikyMushroom + elif (.@id == 1028 && .@score < 175) set .@item$, "CottonCloth"; // Mouboo + elif (.@id == 1029 && .@score < 700) set .@item$, "MauveHerb"; // MauvePlant + elif (.@id == 1030 && .@score < 700) set .@item$, "CobaltHerb"; // CobaltPlant + elif (.@id == 1031 && .@score < 700) set .@item$, "GambogeHerb"; // GambogePlant + elif (.@id == 1032 && .@score < 700) set .@item$, "AlizarinHerb"; // AlizarinPlant + elif (.@id == 1035 && .@score < 300) set .@item$, "SilkCocoon"; // SilkWorm + elif (.@id == 1018 && .@score < 180) set .@item$, "PinkAntenna"; // Pinkie + else end; + makeitem .@item$, 1, getmapname(), rand(POS_X - 1, POS_X + 1), rand(POS_Y - 1, POS_Y + 1); + + if (.@id != 1020 && .@id != 1028 && .@id != 1018 && rand(2) != 1) end; + @value = 1; + callfunc "QuestSagathaHappy"; + end; + +L_FreeRecast: + @chipchipspell[2] = 1; + addtimer 0, strnpcinfo(0) + "::OnSetRecast"; // we can't do it while already overridden, until it reaches a script terminator + end; + +OnDischarge: + if (@chipchipspell[2] < 1) end; + @chipchipspell[2] = 0; + misceffect FX_FIRE_BURST, strcharinfo(0); + overrideattack; + end; + +OnSetRecast: + overrideattack @chipchipspell[1], 1, ATTACK_ICON_SHEARING, 30, strnpcinfo(0)+"::OnAttack"; + end; + +OnInit: + .school = SKILL_MAGIC_NATURE; + set .invocation$, chr(MAGIC_SYMBOL) + "chipchip"; // used in npcs that refer to this spell + void call("magic_register"); + .level = 2; + .exp_gain = 0; + end; +} -- cgit v1.2.3-70-g09d2