SphereCommunity
Spawn activated when a player approach or say xxx - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: Spawn activated when a player approach or say xxx (/Thread-Spawn-activated-when-a-player-approach-or-say-xxx)



Spawn activated when a player approach or say xxx - Pollo - 11-25-2012 06:55 AM

As said in 3d's title.. is there any possibility to set a spawn that activate only when a player pass near or when a player say xxx ?

Example: Norris walk in a dungeon and find an altar.. he says " i'll kick your ass " The invisible spawn activate and open a gate

Example2: Norris walk in a forest and pass near a deactivated spawn.. passing near the spawn activate and monsters spawn making a sort of ambush


I had my serv on runuo before and this was possible thx to xmlspawner. How could we do it with Sphereserv?

thx

thought we can use the @step to "call" an event maybe..


RE: Spawn activated when a player approach or say xxx - Skul - 11-25-2012 07:53 AM

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



RE: Spawn activated when a player approach or say xxx - RanXerox - 11-25-2012 08:12 AM

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.


RE: Spawn activated when a player approach or say xxx - Pollo - 11-27-2012 09:59 PM

10x as usual guys for your help Smile