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
poison problem @Death trigger
Author Message
sagitariuz2
Apprentice
*

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



Post: #1
poison problem @Death trigger
Hi,

I was trying to script an event, to poison players in a radius around the killed npc.

problem is: because of the npc dying, you get poison flagged and then after a second unflagged. no dmg at all.

If I use the script with @GETHIT it works just fine. how to fix?

Code:
[EVENTS e_death_test]
ON=@DEATH
poison_all

[FUNCTION poison_all]
FORCHARS 8 //loop through all chars in 8 tiles distance
    EFFECT 3, i_fx_smoke, 1, 12, 0, 004f5
    SPELLEFFECT s_poison,1,<uid>
ENDFOR
(This post was last modified: 02-28-2013 08:56 AM by sagitariuz2.)
02-28-2013 08:56 AM
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: #2
RE: poison problem @Death trigger
I am guessing because the source of that spell is <uid> and when <uid> dissapears, that source changes to yourself (and you can't damage yourself.)

If that's true, maybe drop an invisible item on the ground, with the same name as the creature, and with an appropriate timer (and attributes) to eventually clean it up, and use the uid of that item as the source of the damage.
02-28-2013 09:41 AM
Find all posts by this user Like Post Quote this message in a reply
sagitariuz2
Apprentice
*

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



Post: #3
RE: poison problem @Death trigger
funny thing is: there are 2 uids being triggert. first the one of the npc and then the one of myself. so i guess its a bug?
03-01-2013 07:53 AM
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: #4
RE: poison problem @Death trigger
Probably not a bug since calling functions and using FOR* loops may change the context of references like I and SRC... which might explain the side-effects you are seeing.

In your case, FORCHARS 8 equates to "for every character within 8 squares"... and you are a character too! If you want it to not EFFECT you, then you need an IF statement to check for that.
(This post was last modified: 03-01-2013 09:20 AM by RanXerox.)
03-01-2013 09:18 AM
Find all posts by this user Like Post Quote this message in a reply
sagitariuz2
Apprentice
*

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



Post: #5
RE: poison problem @Death trigger
i added "POISON 500" after the spelleffect and now its workin.

to remove the npc itself from the forchars, i have first to store it uid and then check in the forchars, if its the one i stored. right?

how to do that?

for the moment i can only use FORCLIENTS to get rid of it, but the other thing would be interesting to know.
(This post was last modified: 03-01-2013 09:35 AM by sagitariuz2.)
03-01-2013 09:28 AM
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: #6
RE: poison problem @Death trigger
I didn't try to test your code... so I am not sure what SRC is in the function... but assuming SRC is the creature that is dying, and you don't want SRC to take damage:

Code:
[FUNCTION poison_all]
FORCHARS 8 //loop through all chars in 8 tiles distance
  IF (<UID>!=<SRC>)
    EFFECT 3, i_fx_smoke, 1, 12, 0, 004f5
    SPELLEFFECT s_poison,1,<uid>
  ENDIF
ENDFOR
03-01-2013 01:05 PM
Find all posts by this user Like Post Quote this message in a reply
sagitariuz2
Apprentice
*

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



Post: #7
RE: poison problem @Death trigger
works. thanks a lot!
03-02-2013 06:20 AM
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)