summaryrefslogtreecommitdiff
path: root/npc/magic/level2-shear.txt
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic/level2-shear.txt')
-rw-r--r--npc/magic/level2-shear.txt54
1 files changed, 54 insertions, 0 deletions
diff --git a/npc/magic/level2-shear.txt b/npc/magic/level2-shear.txt
new file mode 100644
index 00000000..f848b36d
--- /dev/null
+++ b/npc/magic/level2-shear.txt
@@ -0,0 +1,54 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_CHIPCHIP (Level 1)
+// School: Nature 2
+
+function script SK_Shear {
+ .@mobGD=getarg(0, @skillTarget);
+ if (.@mobGD <= 0)
+ return;
+
+ // We only want monsters
+ if (getunittype(.@mobGD) != UNITTYPE_MOB) {
+ dispbottom l("This skill can only be used on monsters!");
+ return;
+ }
+
+ // Global data
+ setarray .@valid, Fluffy, EasterFluffy, SpikyMushroom, Mouboo, MauvePlant, CobaltPlant, GambogePlant, AlizarinPlant, Silkworm, Pinkie;
+ setarray .@prize, WhiteFur, WhiteFur, HardSpike, CottonCloth, MauveHerb, CoblatHerb, GambogeHerb, AlizarinHerb, SilkCocoon, PinkAntenna;
+ setarray .@score, 300, 300, 250, 175, 700, 700, 700, 700, 300, 180;
+
+ // Specific data
+ .@mobID=getunitdata(.@mobGD, UDT_CLASS);
+ .@matk=AdjustSpellpower(40+(10*@skillLv));
+ .@idx=array_find(.@valid, .@mobID);
+
+ // Invalid target
+ if (.@idx < 0) return;
+
+ // Not yet sheared
+ if (array_rfind(@shear, .@mobGD) < 0) {
+ array_push(@shear, @mobGD);
+ if (.@matk > .@score[.@idx])
+ getitem .@prize[.@idx], 1;
+ }
+
+ // Sagratha bonus
+ if (.@mobId == Fluffy || .@mobId == Mouboo || .@mobId == Pinkie)
+ QuestSagathaHappy(any(true, true, false));
+
+ // Special effect
+ specialeffect(FX_MAGIC_SHEAR_CAST, AREA, getcharid(3));
+ specialeffect(FX_MAGIC_SHEAR_CAST, AREA, .@mobGD);
+
+ // Truncate.
+ // We're saving the GID so it must be "big enough"
+ // But not too big so rfind() is not expensive
+ if (getarraysize(@study) > 99) {
+ deletearray(@study, 30);
+ }
+ return;
+}
+