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
Checking for spell casting
Author Message
Kanibal
Master
**

Posts: 255
Likes Given: 6
Likes Received: 30 in 28 posts
Joined: Jun 2012
Reputation: 0



Post: #11
RE: Checking for spell casting
Code:
on=@itemequiptest
if (<act.tdata3> == 4)
  src.sysmessage You can't equip this armor.
return 1
endif

Grandmaster Localhost Admin
02-16-2016 10:29 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
dunnetott
Apprentice
*

Posts: 24
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Feb 2016
Reputation: 0



Post: #12
RE: Checking for spell casting
Nice that worked thanks alot guys ^^
02-16-2016 10:33 PM
Find all posts by this user Like Post Quote this message in a reply
karma
Moderator
****

Posts: 178
Likes Given: 17
Likes Received: 32 in 29 posts
Joined: Jul 2012
Reputation: 3



Post: #13
RE: Checking for spell casting
My fault, the item under @ItemEquipTest is ACT, not SRC. Also, SRC.SYSMESSAGE can be simply SYSMESSAGE.
(This post was last modified: 02-16-2016 11:56 PM by karma.)
02-16-2016 11:55 PM
Find all posts by this user Like Post Quote this message in a reply
Llirik
Journeyman
*

Posts: 115
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #14
RE: Checking for spell casting
Not use @ItemEquipTest use @Equip because @ItemEquipTest already equipped on you!

on=@equip
if (<i.tdata3> == 4)
src.sysmessage You can't equip this armor.
return 1
endif
(This post was last modified: 02-17-2016 09:38 AM by Llirik.)
02-17-2016 09:33 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #15
RE: Checking for spell casting
sysmessage can also be smsg. Tongue

And no, you are wrong Llirik, you use @ItemEquipTest/@EquipTest. @Equip doesn't work the way you think it does. @ItemEquipTest/@EquipTest are fired inside sphere and their whole purpose is to see if character can equip the item. @Equip is just fired when something IS equipped.

http://wiki.sphere.torfo.org/index.php/@Equip

Wiki covers all of this. There is a sequence triggers follow and each normally has its own purpose. I think there is only one trigger missing from the Wiki at the moment. Well, it is there, but not accessible unless you search for it. Trying to remember which one it is. hehe. But yeah. Everything you need is generally outlined in good detail.
(This post was last modified: 02-17-2016 04:34 PM by Khaos.)
02-17-2016 04:31 PM
Find all posts by this user Like Post Quote this message in a reply
Llirik
Journeyman
*

Posts: 115
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #16
RE: Checking for spell casting
I'm sorry!
(This post was last modified: 02-17-2016 05:50 PM by Llirik.)
02-17-2016 05:49 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Llirik's post
Llirik
Journeyman
*

Posts: 115
Likes Given: 0
Likes Received: 10 in 8 posts
Joined: Feb 2015
Reputation: 0

UO Forum

Post: #17
RE: Checking for spell casting
On item:

on=@equip
if (<src.skillclass> == x)
src.sysmessage You can't equip this armor.
return 1
endif

But this long...!
(This post was last modified: 02-18-2016 12:02 AM by Llirik.)
02-18-2016 12:01 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Khaos
Master
**

Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11



Post: #18
RE: Checking for spell casting
Again,

Code:
on=@EquipTest
if (<src.skillclass> == <whatever_class>) && (<src.npc> == 0)
src.smsg You can't equip this armor.
return 1
endif

You missed my point. @Equip is fired AFTER @EquipTest, which @EquipTest is used to see if an item can be equipped or not. @Equip says it is already equipped and now we are processing what we are going to do now it is equipped.

No point in saying sorry if you didn't understand the point I was trying to make. Triggers parse in a specified order. Each trigger has its own functionality. Which I outlined what @EquipTest and @Equip do and the order they go in.

This could be handled on the skillclass itself:
Code:
[skillclass 42]
....

on=@ItemEquipTest
if (<act.type> == t_armor||t_leather_armor) && (<act.tdata3> == 3) // Just using the example above of the person who set the armor type in the tdata3.
src.smsg You can't equip this armor.
return 1
endif

Anyone who has this skillclass won't be able to use said item that way.

Edited this a few times. The original code I redid now checks for brain_player and skillclass. The second one is fired from the player on their skillclass.

The first is fired on every item using that trigger if it is equipped (player and npc). The second only fires on players equipping items (though it will check every armor they equip). The first is OPTIMAL if you don't have your Mobiles equipping a lot of armor. If you have mobiles equipping armor on your server, you might just want to parse it on the player instead.
(This post was last modified: 02-18-2016 09:34 AM by Khaos.)
02-18-2016 09:00 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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