Bob!RynthidZerzelikyrAyanAerlintheNeftetgearknightsdarkisleSanctuary

Select a specific object and cast a spell on it

Unofficial support for the creating and editing of metas.
Swedish Chef
Posts: 2

Select a specific object and cast a spell on it

Post#1 » April 22nd, 2018, 6:52 pm

I'm trying to build a very basic meta that casts BD and the like on my dagger after x minutes. I've tried a few meta expressions, and while i can get them to cast on myself (so like defender on a wand or orb) i cant get them to cast on a specific or selected item.

Code: Select all

/vt mexec actiontrycastbyidontarget[2101,actiontryselect[80347B95]]

or

Code: Select all

/vt mexec actiontrycastbyidontarget[2101,80347B95]

or

Code: Select all

/mt cast cragstones will on ivory orb



where 80347B95 is the specific object code i pulled using "wobjectgetselection[]"

any help or pointing in the right direction would be super duper cool :) Thanks!
0 x

Dmdtt
Moderator
Posts: 261

Re: Select a specific object and cast a spell on it

Post#2 » April 23rd, 2018, 9:27 am

easiest way is to select the orb in one action then

Code: Select all

actiontrycastbyidontarget[2101,wobjectgetselection[]]


in another action.

for casting BD on your dagger you may have to try a number of things to get it selected.

first pull its template type by manually selecting and using

/vt mexec wobjectgettemplatetype[wobjectgetselection[]]

then using that # try

Code: Select all

actiontryselect[wobjectfindininventorybytemplatetype[InputTemplateNumberHere]]


then if that allows you to select it

Code: Select all

actiontrycastbyidontarget[2101,wobjectgetselection[]]


another option that is a bit more clunky is to manually save the dagger into a variable. by selecting it then

Code: Select all

setvar[Dagger,wobjectgetselection[]]


then

Code: Select all

actiontrycastbyidontarget[2101,getvar[Dagger]]


i remember doing this automatically once by reacting off testvar[Dagger]==0 and chat message for hitting something so i know it is out then using the object class for the weapon to select the nearest one using

Code: Select all

actiontryselect[wobjectfindnearestbyobjectclass[1]]


(1 is objectclass for melee weapons) then in another rule

Code: Select all

All testvar[Dagger]==0 and wobjectgetobjectclass[wobjectgetselection[]]==1

the first conditon makes sure that the variable hasnt been set yet and second confirms that selected item is a melee weapon

then for the action

Code: Select all

setvar[Dagger, wobjectgetselection[]]
0 x

Swedish Chef
Posts: 2

Re: Select a specific object and cast a spell on it

Post#3 » April 25th, 2018, 3:26 am

Through the methods you prescribed I was able to select my weapon. However, when trying to cast the spell (defender as an example) the return was 2 from the expressions. maybe it's just a limitation in what vtank expects versus what classic provides?
0 x

Dmdtt
Moderator
Posts: 261

Re: Select a specific object and cast a spell on it

Post#4 » April 25th, 2018, 10:04 pm

the only thing I can think of is are you sure you are using the right spell ids?

also once you confirm the spellid maybe try using magtools casting commands see if that will work for buffing up weapons.
0 x

Return to “VT: Meta Support”

Who is online

Users browsing this forum: No registered users and 0 guests

Login  •  Register