Weapon to not a weapon

For builders to discuss and ask building questions.
Post Reply
User avatar
Gwain
Sword Grand Master
Sword Grand Master
Posts: 2354
Joined: Tue Nov 01, 2005 9:25 pm
Location: Waterdeep

Weapon to not a weapon

Post by Gwain » Mon May 01, 2006 4:16 pm

Is it possible to code a weapon that alters to an non weapon object when something is taken out of it and then back again into a weapon when that part is added again? For example, let's say you have a weapon that is also a sheath, if you draw the weapon from this weapon is it possible that the original weapon can turn into a sheath of sorts until the original weapon is reinseted? Would the code allow for that?
Justice is not neccesarily honourable, it is a tolerable business, in essence you tolerate honour until it impedes justice, then you do what is right.

Spelling is not necessarily correct :)
Dalvyn
Sword Grand Master
Sword Grand Master
Posts: 4708
Joined: Tue Jul 15, 2003 9:26 pm
Location: House of Wonder, Waterdeep

Post by Dalvyn » Tue May 02, 2006 1:47 pm

That might be possible to change the type of an object with a program, yes.

For example:

Code: Select all

>intercept_prog draw~
if wear_loc($o) == -1
  mpechoat $n You should first wear Y before you can do that.
else
  if objval5($o) == 0
    mpechoat $n You draw X from your Y.
    mpechoaround $n $N draws X from $s Y.
    mpoload vnumX
    mpgive iX $n
    mposet on $n $o type sheath
    mposet on $n $o value1 1
    (can also change Y's name/description here)
  else
    mpechoat $n You have already drawn X from your Y!
  endif
endif
~
and

Code: Select all

>intercept_prog sheathe~
if wear_loc($o) == -1
  mpechoat You should first hold/wear your Y before you can do that.
else
  if actorhasobjnum(X)
    if objval5($o) == 1
      mpechoat $n You sheathe your X in your Y
      mposet on $n $o value5 0
      mposet on $n $o type (other type)
      mposet on $n $o (can also change name/description here)
      mpjunk iX $n
    else
      mpechoat $n There is already an X in your Y!
    endif
  else
    mpechoat $n You have no X to sheathe in your Y!
  endif
endif
~
Image
Post Reply