Skul
Master
Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9
|
RE: Spawn activated when a player approach or say xxx
1. Use a [speech xx] block on players, here's an example:
Code:
[speech spk_activate]
on=*
if (strmatch(*i'll kick your ass*,<args>))
if (<isneartype t_ankh>)
//add newnpc
endif
endif
Add the speech block to a player with dspeech +spk_activate
2. Yes, you can use @step in a [regiontype xx] event. Here's an example:
Code:
[regiontype r_dungeon_activate]
on=@step
foritems 8
if (<type>==t_spawn_char)
if !(<more2>) //is deactivated?
more2=1
timer=0 //activate
endif
endif
endfor
"I ask a question to the answer I already know."
Marchadium :: http://www.marchadium.ca/ :: Join us!
|
|
11-25-2012 07:53 AM |
|
|
RanXerox
Master
Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19
|
RE: Spawn activated when a player approach or say xxx
Here is another idea... a "multi" item with a defined area, where the component of the multi is a creature spawner, and the area of effect is defined by the size of the region (my example item is MULTIREGION=-2,-2,2,2 which is a 5x5 area):
Code:
[SPEECH speech_spawntrigger]
ON=*fight me*
FORITEMS 2
IF (<TYPE>==t_spawn_char)
SRC.SYSMESSAGE @032 Respawning <NAME>
IF <MORE2>==1
MORE2=0
ENDIF
TIMER=1
ENDIF
ENDFOR
[ITEMDEF i_multi_spawntrigger]
NAME=Spawn Area
TYPE=t_multi
TSPEECH=speech_spawntrigger
MULTIREGION=-2,-2,2,2
COMPONENT=i_worldgem_lg,0,0,0
ON=@Create
ATTR=attr_move_never|attr_invis
COLOR=021
Keep in mind that since it is a multi (albeit an invisible one), it does have a name and region flags etc... so if you are in the range of the speech you are also in the region of the multi so the result of .where will include the multi's name.
|
|
11-25-2012 08:12 AM |
|
|