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
Shield with magic reflect @equip
Author Message
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #4
RE: Shield with magic reflect @equip
Look at the code from the shield in the default script pack:
Code:
ON=@EquipTest //You do checks here BEFORE equipping it, so anyone wich is not in ORDER guild can NOT equip it
IF (<src.isgm>) || (<src.memoryfindtype.memory_guild.link.align>==1)
    RETURN 0 // If I'm GM or my guild.align is order then I pass and go to @Equip
ENDIF
SRC.SOUND=snd_SPELL_LIGHTNING
SRC.SYSMESSAGELOC color_text,1062092//"Your body reacts violently from the pain."
SRC.DAMAGE=<src.hits>/2 <DEF.dam_physical>
RETURN 1

ON=@DAMAGE //I am receiving damage (the shield)
IF (<CONT.MEMORYFINDTYPE.MEMORY_GUILD.LINK.ALIGN>==1)
    RETURN 0 //My wearer is in a order guild so everything is ok
ELSE // but if i'm not weared by a order player .... he receives damage too
CONT.SOUND=snd_spell_lightning
CONT.SYSMESSAGELOC color_text,1062092//"Your body reacts violently from the pain."
CONT.DAMAGE=<CONT.HITS>/2 <DEF.dam_physical>
//UNEQUIP // Uncomment this line to make the shield unequip, if you want.

With this code you can remove your timerd=1 in the @Create and the whole @Timer trigger.

And here you have what you want ...
ON=@Equip
SRC.SpellEffect=s_magic_reflection,100.0,<uid>

Additionally you can make it to only cast the spell once each X seconds:

Code:
ON=@Equip
if !(<tag0.spell_on_cooldown>)
SRC.SpellEffect=s_magic_reflection,100.0,<uid> //this cast the spell in the character (src)
tag.spell_on_cooldown=1 // this tell the item that it casted the spelleffect recently
timerf 10,tag.spell_on_cooldown // the 10 means 10 seconds, change it .
endif
08-07-2014 08:30 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Post Reply 


Messages In This Thread
RE: Shield with magic reflect @equip - XuN - 08-07-2014, 05:28 PM
RE: Shield with magic reflect @equip - XuN - 08-07-2014 08:30 PM

Forum Jump:


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