diff options
Diffstat (limited to 'npc/magic/config.txt')
-rw-r--r-- | npc/magic/config.txt | 111 |
1 files changed, 77 insertions, 34 deletions
diff --git a/npc/magic/config.txt b/npc/magic/config.txt index 141c2dd3..608b2223 100644 --- a/npc/magic/config.txt +++ b/npc/magic/config.txt @@ -190,40 +190,6 @@ function script rectharm { } -// mescordialog(text, color, {dialog=1}) -function script mescordialog { - if (getarg(2, true)) - mesc getarg(0), getarg(1); - else - dispbottom col(getarg(0), getarg(1)); - return; -} - -// ShowAbizit({dialog=1}) -function script ShowAbizit { - .@dial=getarg(0, true); - if (.@dial) - mesn l("Current Magic Control"); - - // FIXME - .@val=MAGIC_EXP+rand(-MAGIC_LVL*5, MAGIC_LVL*5); - .@base=((MAGIC_LVL*2)**3); - if (.@val > .@base*5) - mescordialog l("You are perfectly in control of your magic."), 3, .@dial; - else if (.@val > .@base*4) - mescordialog l("You are mostly in control of your magic."), 2, .@dial; - else if (.@val > .@base*3) - mescordialog l("You are somewhat in control of your magic."), 4, .@dial; - else if (.@val > .@base*2) - mescordialog l("Your magic is more powerful than you, but you can control."), 7, .@dial; - else if (.@val > .@base) - mescordialog l("You still are overwhelmed by your magic."), 6, .@dial; - else - mescordialog l("You are completly overwhelmed by your magic."), 1, .@dial; - return; -} - - // SK_summon(ID, amount, mexp) function script SK_summon { .@mob=getarg(0); @@ -344,12 +310,89 @@ function script massprovoke { return; } + +// mescordialog(text, color, {dialog=1}) +function script mescordialog { + if (getarg(2, true)) + mesc getarg(0), getarg(1); + else + dispbottom col(getarg(0), getarg(1)); + return; +} + +// ShowAbizit({dialog=1}) +function script ShowAbizit { + .@dial=getarg(0, true); + if (.@dial) + mesn l("Current Magic Control"); + + // FIXME + .@val=MAGIC_EXP+rand(-MAGIC_LVL*5, MAGIC_LVL*5); + .@base=((MAGIC_LVL*2)**3); + if (.@val > .@base*5) + mescordialog l("You are perfectly in control of your magic."), 3, .@dial; + else if (.@val > .@base*4) + mescordialog l("You are mostly in control of your magic."), 2, .@dial; + else if (.@val > .@base*3) + mescordialog l("You are somewhat in control of your magic."), 4, .@dial; + else if (.@val > .@base*2) + mescordialog l("Your magic is more powerful than you, but you can control."), 7, .@dial; + else if (.@val > .@base) + mescordialog l("You still are overwhelmed by your magic."), 6, .@dial; + else + mescordialog l("You are completly overwhelmed by your magic."), 1, .@dial; + return; +} + +// getactivatedpoolskilllist(?) +function script getactivatedpoolskilllist { + @skilllist_count=bitmask_count(FOCUSING); + // FIXME @skilllist_name$ @skilllist_id? Or just rewrite Luca + return @skilllist_count; +} + +// getdeactivatedpoolskilllist(?) +function script getdeactivatedpoolskilllist { + @skilllist_count=bitmask_count(FOCUSING)-FSKILL_TOTAL; + return @skilllist_count; +} + +// getpoolskillFID(ID) +function script getpoolskillFID { + switch (getarg(0)) { + case SKILL_MALLARDS_EYE: return FSKILL_MALLARDS_EYE; + case SKILL_BRAWLING: return FSKILL_BRAWLING; + case SKILL_SPEED: return FSKILL_SPEED; + case SKILL_RESIST_POISON: return FSKILL_RESIST_POISON; + case SKILL_ASTRAL_SOUL: return FSKILL_ASTRAL_SOUL; + case SKILL_RAGING: return FSKILL_RAGING; + } + return Exception("Invalid focus skill ID: "+getarg(0), RB_DEFAULT|RB_ISFATAL); +} + +// poolskill(skill) +function script poolskill { + if (bitmask_count(FOCUSING) < getskilllv(SKILL_POOL)) + FOCUSING=FOCUSING | getpoolskillFID(getarg(0)); + return; +} + +// unpoolskill(skill) +function script unpoolskill { + .@f=getpoolskillFID(getarg(0); + if (FOCUSING & .@f) + FOCUSING=FOCUSING ^ .@f); + return; +} + - script Magic Load NPC_HIDDEN,{ OnInit: end; OnSkillInvoke: + callfunc("HUB_SkillInvoke"); end; OnPCBonusEvent: + callfunc("HUB_PCBonus"); end; } |