diff options
author | Jesusaves <cpntb1@ymail.com> | 2021-04-14 02:00:51 -0300 |
---|---|---|
committer | Jesusaves <cpntb1@ymail.com> | 2021-04-14 02:00:51 -0300 |
commit | 98ba4904651a9d6cce3a4c79c85b609d02594bc5 (patch) | |
tree | 0a363ad631953ec0b5d1de0238fe569ba3b4086c /npc/magic | |
parent | 851912c893af673113b36bbdcc68b0db34f71cce (diff) | |
download | serverdata-98ba4904651a9d6cce3a4c79c85b609d02594bc5.tar.gz serverdata-98ba4904651a9d6cce3a4c79c85b609d02594bc5.tar.bz2 serverdata-98ba4904651a9d6cce3a4c79c85b609d02594bc5.tar.xz serverdata-98ba4904651a9d6cce3a4c79c85b609d02594bc5.zip |
Add monsterinfo spell, wich replaces the following ones:
inwilt miteyo inzuwilt
Diffstat (limited to 'npc/magic')
-rw-r--r-- | npc/magic/final.txt | 2 | ||||
-rw-r--r-- | npc/magic/level0-monsterinfo.txt | 38 |
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; +} + |