XuN ![](images/flags/Spain.png)
Sphere Developer
![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif) ![*](images/star.gif)
Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30
![]()
|
RE: Need help in general Scripting
Use what criminal wrote, it is all that you need.
However i'm going to explain you some things you had wrong on your code in case you can make use of it on the future:
IF (<VAR0.f_spell_is_aggressive> = 1) //WRONG: One = means 'set', in this case you are setting that VAR to 1 everytime so you are forcing Sphere to automatically pass this check always.
IF (<VAR0.f_spell_is_aggressive> == 1) // Double = means compare, this is what you must use when comparing values.
NOTE: Functions can return values, there is no need to store anything on VARs to check them later:
Code:
[FUNCTION f_test]
if (<serv.spell.<argn1>.flags>&spellflag_harm)
return 1
endif
return 0
ON=@SpellEffect
if (<f_test <argn1>> == 1) // So you don't need to set a VAR and check for it later, you can do it all at once.
SRC.SYSMESSAGE You cannot harm players in this dungeon.
return 1
endif
(This post was last modified: 05-04-2016 04:30 PM by XuN.)
|
|
05-04-2016 04:29 PM |
|
|