Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Checking for spell casting
Author Message
dunnetott
Apprentice
*

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



Post: #1
Checking for spell casting
im trying to check for a spell during casting so i can allow the spell depending on what spell is cast

did something like this

ON=@SPELLCAST
if (<src.cast> == S_BLESS)
return 0
else
return 1
endif
02-16-2016 10:11 AM
Find all posts by this user Like Post Quote this message in a reply
Kanibal
Master
**

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



Post: #2
RE: Checking for spell casting
Code:
on=@spellcast
if (<argn1>==17) // Spell Bless
  return 0 // Continue
else
  return 1 // Stop
endif

Grandmaster Localhost Admin
02-16-2016 10:31 AM
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: #3
RE: Checking for spell casting
oh nice that works Thanks alot ^^

you dont happen to know how to disable a [skillclass x] to not be able to use say like a platemail?
(This post was last modified: 02-16-2016 10:43 AM by dunnetott.)
02-16-2016 10:34 AM
Find all posts by this user Like Post Quote this message in a reply
Kanibal
Master
**

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



Post: #4
RE: Checking for spell casting
(02-16-2016 10:34 AM)dunnetott Wrote:  you dont happen to know how to disable a [skillclass x] to not be able to use say like a platemail?
Doubt

Code:
[skillclass x]
...
events=e_class_x

[events e_class_x]
on=@itemequiptest
if ...

UPD

Grandmaster Localhost Admin
(This post was last modified: 02-16-2016 10:56 AM by Kanibal.)
02-16-2016 10:44 AM
Visit this user's website 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: #5
RE: Checking for spell casting
on=@itemequiptest
if <src.findid.i_ring_gold>
say My precious!
src.str += 1
endif

Smile

Use this:

ON=@Login
if <src.skillclass>==x
src.events e_class_x
endif
(This post was last modified: 02-16-2016 05:53 PM by Llirik.)
02-16-2016 04:16 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: #6
RE: Checking for spell casting
there is no way i could do something like

on=@itemequiptest
if (<src.findtype.t_armor_plate>)
say you cannot wear that.
endif

or do i have to add items invidual ?
02-16-2016 07:06 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: #7
RE: Checking for spell casting
In my server i added a TDATA3 property to each armor piece (you can also use a TAG if you wish):
0: cloth
1: leather
2: studded
3: ringmail
4: chainmail
5: plate
6: bone
7: dragon
etc..

Then you can check for the TDATA3 inside the SKILLCLASS block:
Code:
ON=@ItemEquipTest
IF (<SRC.TDATA3>==5)
SRC.SYSMESSAGE You can't equip this armor.
RETURN 1
ENDIF
You can also put the trigger directly inside the SKILLCLASS block without having to attach an event to it.


For the spell, you can dynamically get the number from the defname this way:
Code:
[FUNCTION spellNo] //ARGS=defname of the spell
RETURN <HVAL <ARGS>&(~0ca000000)>
(This post was last modified: 02-16-2016 08:59 PM by karma.)
02-16-2016 08:57 PM
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: #8
RE: Checking for spell casting
how do i define tdata3? sorry just started to relearn sphere scripting been 12 years since i last used it.
(This post was last modified: 02-19-2016 10:21 AM by dunnetott.)
02-16-2016 09:04 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: #9
RE: Checking for spell casting
In the definition of the item

[ITEMDEF 0xxxx]
DEFNAME=i_bone_chest //Example
NAME=bone chest
..
TDATA3=6

You have to put it before any trigger
02-16-2016 10:11 PM
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: #10
RE: Checking for spell casting
Code:
[ITEMDEF 013bb]
DEFNAME=i_chainmail_coif
TYPE=T_ARMOR
RESOURCES=10 i_ingot_iron
SKILLMAKE=BLACKSMITHING 14.5
TDATA3=4
WEIGHT=7
FLIP=1
ARMOR=23
REQSTR=20
CATEGORY=Provisions - Armor
SUBSECTION=Chainmail Armor
DESCRIPTION=Chainmail Coif
DUPELIST=013c0

and i put this under the skillclass

Code:
ON=@ItemEquipTest
IF (<SRC.TDATA3>==4)
SRC.SYSMESSAGE You can't equip this armor.
RETURN 1
ENDIF

and i get a console output
Can't resolve <SRC.TDATA3>
Undefined symbol
(This post was last modified: 02-16-2016 10:31 PM by dunnetott.)
02-16-2016 10:13 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)