Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Command to force a NPC to attack a given target
Author Message
Nachtmusique
Journeyman
*

Posts: 89
Likes Given: 0
Likes Received: 6 in 6 posts
Joined: Mar 2012
Reputation: 0



Post: #11
RE: Command to force a NPC to attack a given target
No script is needed to do what he is asking. There in no command function for it, but since all npcs act as pets to GMs, you can just say "all attack" or "bob attack".
05-01-2012 07:55 AM
Find all posts by this user Like Post Quote this message in a reply
Boydon
Apprentice
*

Posts: 5
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Apr 2012
Reputation: 0



Post: #12
RE: Command to force a NPC to attack a given target
(05-01-2012 03:54 AM)khaos Wrote:  Just script the function using targeting code.

Some advice on targeting code in sphere 51a? Cause the ATTACK function seems to have the same behavior also script side (the NPC is attacking me and not the desired target).

I've tried many ways also forcing the ACT of the NPC supposed to attack and giving the desired target'UID as argument of the ATTACK function, but with no luck...

This is what I have so far:
Code:
[7020]
//Wand of attack
NAME=Wand of attack
ID=0df2
COLOR=GOLDEN_ARMOR_COLOR
TYPE=13
HITPOINTS=101-115
REQSTR=0
WEIGHT=1
ATTR=04

CATEGORY=Custom
SUBSECTION=Boydon
DESCRIPTION=Wand of Attack

ONTRIGGER=DCLICK
    IF (<SRC.ACCOUNT.PLEVEL> >= 2)
        SRC.SYSMESSAGE Please select target of attack
        TARGET
        RETURN 0
    ELSE
        SRC.SYSMESSAGE I'm a lamer and I will go to jail for using this!
        SRC.JAIL
        REMOVE
        RETURN 1        
    ENDIF
    
ONTRIGGER=TARGON_ITEM
    SRC.SYSMESSAGE You have to target a player or an NPC...
    RETURN 1

ONTRIGGER=TARGON_CHAR
    SRC.NEWITEM 7021
    SRC.ACT.MORE1=<SRC.TARG.UID>
    SRC.ACT.EQUIP
    SRC.ACT.DCLICK
    RETURN 1

[7021]
ID=1EA7
NAME=Wand of Attack memory
TYPE=13
ATTR=96

ONTRIGGER=DCLICK
    SRC.SYSMESSAGE Please select the soruce of the attack...
    RETURN 0

ONTRIGGER=TARGON_CHAR
    SRC.TARG.ACT=<MORE1>
    SRC.TARG.UPDATE
    SRC.TARG.ATTACK <MORE1>
    REMOVE
    RETURN 1

ONTRIGGER=TARGON_ITEM
    SRC.MESSAGE You have to target a player or an NPC, please try again...
    REMOVE
    RETURN 1
(This post was last modified: 05-01-2012 11:08 AM by Boydon.)
05-01-2012 11:03 AM
Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #13
RE: Command to force a NPC to attack a given target
Trying using 'link' in your targeting maybe? Have 1st target attack the linked second target and vice versa? I am not familiar with 51a coding. I can just offer coding advice as I remember it from the pre 56b era... ie 55r and 55i...

@Nachtmusique
If he is not trying to do this as a GM but as a provocation or some other effect, that will not help one bit Smile
05-01-2012 11:36 AM
Find all posts by this user Like Post Quote this message in a reply
evening
Journeyman
*

Posts: 137
Likes Given: 0
Likes Received: 14 in 9 posts
Joined: Apr 2012
Reputation: 1

Finally Land

Post: #14
RE: Command to force a NPC to attack a given target
on=@attack
or
ON=@SeeNewPlayer
if (<var.ack> == 0) && (<src.hits> > 0)
var.ack=<src.serial>
else
var.ack=
endif
acttack <var.ack>
01-11-2013 04:18 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #15
RE: Command to force a NPC to attack a given target
This thread was last active in April.. Please pay attention to dates of posts to save bringing up old threads.

[Image: 2nis46r.jpg]
01-11-2013 11:47 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
jdchixin
Journeyman
*

Posts: 51
Likes Given: 9
Likes Received: 0 in 0 posts
Joined: Feb 2013
Reputation: 0



Post: #16
RE: Command to force a NPC to attack a given target
51a has no function. no @attact

if you want attact s b. you must know his uid.

attact <uid>
02-23-2013 08:48 PM
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)