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
NPC Follow/Guard
Author Message
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #2
RE: NPC Follow/Guard
It is possible, yes. But you have to script it. I use this system (it´s in spanish, sorry).

Code:
[ITEMDEF i_memory_npc_seguir]
ID = i_memory
NAME = Memoria de Seguir
TYPE = t_eq_script

ON=@EQUIP
    TIMER = 2
    TAG.PASOS = 1000            
    CONT.EVENTS +e_siguiendo
    
ON=@UNEQUIP
    CONT.ACTION=
    IF (<CONT.SPAWNITEM> == 0)
    CONT.TIMERF 300 HOMEDIST = 15
    ELSE
        CONT.TIMERF 300 CONT.HOMEDIST = <CONT.SPAWNITEM.MOREZ>            
        CONT.TIMERF 300 CONT.HOME = <CONT.SPAWNITEM.P>        
    ENDIF
    CONT.EVENTS -e_siguiendo
    
ON=@TIMER
    REF1 = <TAG.OBJETIVO_SEGUIR>
    IF (<REF1.ISCHAR>)
        IF (<REF1.DISTANCE <CONT.UID>> <= 15)
            IF (<TAG.PASOS> > 0)
                CONT.HOME = <REF1.P>
                CONT.ACTION = 06d
                IF !(<TAG0.NO_TIEMPO>)
                    TAG.PASOS -= 1
                ENDIF
                TIMER = 2
                RETURN 1
            ENDIF
        ENDIF
    ENDIF
    REMOVE
    RETURN 1
    
[EVENTS e_siguiendo]
ON=@ATTACK
    FINDID.i_memory_npc_seguir.REMOVE

ON=@GETHIT
    FINDID.i_memory_npc_seguir.REMOVE

You have to add this timer to the npc with the correct TAGs, TAG.OBJETIVO_SEGUIR and TAG.NO_TIEMPO, of course you can add more interrupts to the timer at the event.
(This post was last modified: 05-16-2013 07:39 PM by Gil Amarth.)
05-16-2013 07:36 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Messages In This Thread
NPC Follow/Guard - Staff_Stanic - 05-16-2013, 03:51 AM
RE: NPC Follow/Guard - Gil Amarth - 05-16-2013 07:36 PM
RE: NPC Follow/Guard - Staff_Stanic - 05-17-2013, 01:35 AM

Forum Jump:


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