SphereCommunity
Wizard NPC - Caster Only? - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Wizard NPC - Caster Only? (/Thread-Wizard-NPC-Caster-Only)



Wizard NPC - Caster Only? - Chukwuemeka - 05-19-2017 03:58 AM

Hi!

I'm trying to create a wizard NPC that will attack only with spells.

Obvious problem is the usual behavior for him is punch everyone with the spellbook.

I tried looking around here for NPC AI scripts and tried canceling his <ACTION> but no luck so far.

Is there a simple way I can avoid all that punching that and make him only a caster?


Thanks once again. Smile


RE: Wizard NPC - Caster Only? - darksun84 - 05-19-2017 04:54 AM

Hmm that's weird, actually NPCs spams a lot of spell, does the wizard's spellbook contain any spell?


RE: Wizard NPC - Caster Only? - WRWR - 05-19-2017 05:11 PM

check CAN flags


RE: Wizard NPC - Caster Only? - Chukwuemeka - 05-20-2017 03:44 AM

(05-19-2017 04:54 AM)darksun84 Wrote:  Hmm that's weird, actually NPCs spams a lot of spell, does the wizard's spellbook contain any spell?

He cast spells, that is not a problem, but also I would like to avoid him running towards players trying to punch them.
Is there a way to make him NOT use wrestling at all?

(05-19-2017 05:11 PM)WRWR Wrote:  check CAN flags

I did... but uhh, didn't find anything that could help me, I think


RE: Wizard NPC - Caster Only? - Chukwuemeka - 05-24-2017 03:46 AM

Had no luck with this yet. Any tips?


RE: Wizard NPC - Caster Only? - darksun84 - 05-24-2017 04:02 AM

try with the @npcactfight trigger

see:
Code:
17-05-2015, XuN
Updated @NPCActFight:
    Added - local.skill // Setting this to any skill will make the NPC begin this skill
    Added - local.spell // For magic skills this will be the casted spell
    Added - ACT // This will refer to the target, must be set since the trigger is using SRC for the first enemy
    Added - return 2 // The code above will only work when return = 2
Removed NPC_AI_STRICTCAST and all the invented casts from npcs.This can be reverted applying a trigger for npcs like this:
    ON=@NPCActFight
    if (<magery> > 0)
        local.spell=<r1,64>
        while (<local.spell> < 64)
            if (<CanCast <local.spell>>)
                local.skill=magery
                return 2
            else
                local.spell ++
            endif
        endwhile
    endif    //same for the other magic skills.
and
https://wiki.spherecommunity.net/index.php?title=@NPCActFight