The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Wizard NPC - Caster Only?
Author Message
Chukwuemeka
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2016
Reputation: 0



Post: #1
Question Wizard NPC - Caster Only?
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
05-19-2017 03:58 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: Wizard NPC - Caster Only?
Hmm that's weird, actually NPCs spams a lot of spell, does the wizard's spellbook contain any spell?
05-19-2017 04:54 AM
Find all posts by this user Like Post Quote this message in a reply
WRWR
Journeyman
*

Posts: 212
Likes Given: 30
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 1



Post: #3
RE: Wizard NPC - Caster Only?
check CAN flags
05-19-2017 05:11 PM
Find all posts by this user Like Post Quote this message in a reply
Chukwuemeka
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2016
Reputation: 0



Post: #4
RE: Wizard NPC - Caster Only?
(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
05-20-2017 03:44 AM
Find all posts by this user Like Post Quote this message in a reply
Chukwuemeka
Apprentice
*

Posts: 12
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Nov 2016
Reputation: 0



Post: #5
RE: Wizard NPC - Caster Only?
Had no luck with this yet. Any tips?
05-24-2017 03:46 AM
Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #6
RE: Wizard NPC - Caster Only?
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.p...PCActFight
05-24-2017 04:02 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)