summaryrefslogtreecommitdiff
path: root/npc/magic
diff options
context:
space:
mode:
Diffstat (limited to 'npc/magic')
-rw-r--r--npc/magic/final.txt2
-rw-r--r--npc/magic/level0-monsterinfo.txt38
2 files changed, 40 insertions, 0 deletions
diff --git a/npc/magic/final.txt b/npc/magic/final.txt
index 5eec2e09..964cf8bf 100644
--- a/npc/magic/final.txt
+++ b/npc/magic/final.txt
@@ -38,6 +38,8 @@ function script HUB_SkillInvoke {
// Level 1
case SKILL_ABIZIT:
SK_Abizit(); break;
+ case SKILL_MONSTERINFO:
+ SK_Monsterinfo(); break;
case EVOL_AREA_PROVOKE:
SK_Itenplz(); break;
case SKILL_FLAR:
diff --git a/npc/magic/level0-monsterinfo.txt b/npc/magic/level0-monsterinfo.txt
new file mode 100644
index 00000000..9161e12c
--- /dev/null
+++ b/npc/magic/level0-monsterinfo.txt
@@ -0,0 +1,38 @@
+// The Mana World script
+// Author: Jesusalva <jesusalva@themanaworld.org>
+//
+// Magic Script: SKILL_MONSTERINFO (Level 1)
+// School: General 1
+
+function script SK_Monsterinfo {
+ .@mobId=getunitdata(@skillTarget, UDT_CLASS);
+ if (.@mobId > 1000) {
+ // Decide how much detail you get based on how much magic you have
+ if (getskilllv(SKILL_MAGIC) > 2) {
+ charcommand("@mi "+.@mobId);
+ } else {
+ .@mhp = getmonsterinfo(.@mobId, MOB_MAXHP);
+ // Truncate HP
+ if (.@mhp > 1000)
+ .@mhp -= .@mhp % 1000;
+ else if (.@mhp > 100)
+ .@mhp -= .@mhp % 100;
+ else
+ .@mhp -= .@mhp % 10;
+ // Randomize atk
+ .@atk = rand2(getmonsterinfo(.@mobId, MOB_ATK1),
+ getmonsterinfo(.@mobId, MOB_ATK2));
+ // Send the obfuscated information
+ dispbottom l("%s - Level %d (~%s HP, ~%s ATK)",
+ getmonsterinfo(.@mobId, MOB_NAME),
+ getmonsterinfo(.@mobId, MOB_LV),
+ fnum(.@mhp),
+ fnum(.@atk));
+ }
+ } else {
+ // Not a valid monster
+ dispbottom l("This is not a monster; I cannot use monsterinfo on it.");
+ }
+ return;
+}
+