Welcome to the Builder Academy

Question Is there something to check if a specific item is being wielded.

More
30 Oct 2013 20:54 #4449 by Treyorn
I know you can check to see if the player is wielding an item with %actor.eq%(wield), but is there a way to check for a specific weapon.

For example:
Code:
Name: 'block troll king entrance without flame weapon', VNum: [ 6721], RNum: [ 936] Trigger Intended Assignment: Rooms Trigger Type: Leave , Numeric Arg: 100, Arg list: None Commands: if %direction% == south if %actor.eq(wield)% == 6719 return 1 else return 0 %send% %actor% A force blocks you from going to the south. %send% %actor% You hear a voice, 'Only the adventurer with a legendary weapon of Flames may proceed!' end end

I essentially want to block any access to the room to the south, unless they are wielding a specific weapon. The block works fine. Any help would be appreciated.

if %actor.eq(wield)% == 6719 <- I know this doesn't work but I figured it would be a decent example to try and explain what I am trying to do.

Thanks,

Treyorn
LuminariMUD

Please Log in or Create an account to join the conversation.

More
30 Oct 2013 21:51 #4451 by thomas
www.tbamud.com/Oasis_DG_pages/contents/variables.htm

%actor.eq(wield)% is an object var in itself, so to get the vnum, use
Code:
%actor.eq(wield).vnum%
You can even use the builtin equality check:
Code:
if %actor.eq(wield).vnum(6719)% ... end

Please Log in or Create an account to join the conversation.

More
31 Oct 2013 13:15 #4453 by Treyorn
Thank you much! I ended up creating a variable because there are 4 different weapons and had a wear/remove trigger added to each weapon. I will post what I did a bit later.

Please Log in or Create an account to join the conversation.

More
31 Oct 2013 16:01 #4454 by Treyorn
Here is what I did:
Code:
Name: 'block troll king entrance without flame weapon', VNum: [ 6721], RNum: [ 936] Trigger Intended Assignment: Rooms Trigger Type: Leave , Numeric Arg: 100, Arg list: None Commands: if %direction% == south && %actor.is_pc% if %actor.varexists(flameweapon_yes)% return 1 else return 0 %send% %actor% A force blocks you from going to the south. %send% %actor% You hear a voice, 'Only the adventurer with a legendary weapon of Flames may proceed!' end end
Code:
Name: 'set flame variable with weapon wield Treyorn', VNum: [ 6722], RNum: [ 937] Trigger Intended Assignment: Objects Trigger Type: Wear , Numeric Arg: 100, Arg list: None Commands: set flameweapon_yes 1 remote flameweapon_yes %actor.id%
Code:
Name: 'remove flame variable with weapon removal Treyorn', VNum: [ 6723], RNum: [ 938] Trigger Intended Assignment: Objects Trigger Type: Remove , Numeric Arg: 100, Arg list: None Commands: rdelete flameweapon_yes %actor.id%

This way I can add weapons and just attach the triggers instead of editing the triggers in the future.

Please Log in or Create an account to join the conversation.

More
01 Nov 2013 00:47 #4455 by Parnassus
If you've got four different weapons, did you want all four to be used interchangeably? Or did you want different weapons in different cases, such as to pass through different door? It looks like you've got four flame weapons, such as sword, dagger, axe and spear or whatever and any of the four will get you through the door.

But just in case you decide to go with flames to see the trolls, ice to see the orcs, water to see the mers, air to see the fae, or something of the sort, you could think about changing the trigger to something like (untested)
set %self%_yes 1
remote %self%_yes %actor.id%

Please Log in or Create an account to join the conversation.

Time to create page: 0.201 seconds