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
Spawn activated when a player approach or say xxx
Author Message
Pollo
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #1
Spawn activated when a player approach or say xxx
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..
(This post was last modified: 11-25-2012 07:03 AM by Pollo.)
11-25-2012 06:55 AM
Find all posts by this user Like Post Quote this message in a reply
Skul
Master
**

Posts: 413
Likes Given: 0
Likes Received: 19 in 15 posts
Joined: Jun 2012
Reputation: 9



Post: #2
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
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #3
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
Find all posts by this user Like Post Quote this message in a reply
Pollo
Apprentice
*

Posts: 22
Likes Given: 0
Likes Received: 0 in 0 posts
Joined: Oct 2012
Reputation: 0



Post: #4
RE: Spawn activated when a player approach or say xxx
10x as usual guys for your help Smile
11-27-2012 09:59 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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