Khaos 
Master
 
Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11
![]()
|
RE: special forces attacking npc with karma < 0
The original post asked for rangers to attack monsters, not players. Also @SeeNewPlayer?! It should be @NPCSeeNewPlayer.
Just put this on your ranger's. Attach it in their core code or use events. Whichever you choose. Technically this is NOT what you asked for. If you get into more detail I can script what you originally wanted. You asked for Ranger's WITHIN Yell distance to attack for your char. This script works a bit different. This will fire off with a ranger in a sector that is not asleep. It will attack anything -800 or worse in karma and call for aid of other rangers within yell distance to attack that same target.
Code:
// This fires when a Mobile looks at ANY character (not just a player).
on=@NPCLookAtChar
if (<src.karma> > -800)
return 1 // We want to keep looking for evil.
endif
if (<src.isowner> == 1)
return 1 // I won't attack my owner if I am hired.
endif
attack <src.uid> // We will attack the mobile we see
ForChars <serv.distanceyell> // more accurate if you parse a different value.
if (<src.baseid> == c_ranger) || (<src.baseid> == c_ranger_f)
attack <src.uid>
endif
endfor
Code:
[speech spk_ranger_aid]
on=*Help*
if (!<isowner>)
return 1
endif
forChars <serv.distanceyell>
if (<<local._for>.npc> != 0) && (<<local._for>.uid.karma> < -799)
attack <<local._for>.uid>
return 0
endif
endfor
I think this is more what you were looking for. Add this via tspeech. When the NPC's hears a player yell for HELP. It will attack the first EVIL NPC within yell distance.
This can be refined more to store the players position and ranger's and only attack things within that distance. Though, we are getting awfully technical at that point.
(This post was last modified: 03-02-2016 04:26 AM by Khaos.)
|
|
02-17-2016 05:03 PM |
|
|