Khaos
Master
Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11
|
RE: Armor Packing
Code:
[template loot_platemail_armor]
category=Whatever
subsection=Whatever
description=Platemail Armor Set
CONTAINER=i_bag
item=i_platemail_gorget
item=i_platemail_helm
item=i_platemail_tunic
item=i_platemail_legs
item=i_platemail_arms
item=i_platemail_gloves
or
Code:
[itemdef i_deed_for_a_platemail_armor_set]
id=i_deed
name=deed for a platemail armor set
type=t_normal
weight=1
category=whatever
subsection=whatever
description=Deed for a Platemail Armor Set
on=@DClick
serv.newitem i_platemail_gorget,,<src>
serv.newitem i_platemail_tunic,,<src>
serv.newitem i_platemail_helm,,<src>
serv.newitem i_platemail_gloves,,<src>
serv.newitem i_platemail_legs,,<src>
serv.newitem i_platemail_arms,,<src>
remove
|
|
12-29-2013 03:39 AM |
|
|
Khaos
Master
Posts: 595
Likes Given: 166
Likes Received: 83 in 51 posts
Joined: Mar 2012
Reputation: 11
|
RE: Armor Packing
In fact... let me know how this works! Untested; but should be awesome. Basically it will let you store any armor type in the deed of each piece minus the shield (look it over to add that in). It will store the info via a tag system and unpack it via the same system. Meanwhile keeping the deed in existence, changing the name on it... and color.
Updated: Switched parsing to EXPLODE and remove OCOLOR variable and now storing colors via a def.
Code:
[itemdef i_armor_packing_deed]
id=i_deed
name=armor packing deed
type=t_normal
weight=1
category=Dat System
subsection=Dem Feels about Armor Packing
description=Armor Packing Deed
on=@Create
attr=attr_blessed
color=pack_deed_color
tag0.armor=0
on=@DClick
if (<cont> != <src>)
src.smsg This item must be in your backpack to use it.
return 1
endif
if (<tag.packed> == 1)
if (<cont> != <src>)
src.smsg This item must be in your packpack to use it.
return 1
endif
if !(<isempty <tag.arms>>)
armor_unpack arms
endif
if !(<isempty <tag.gloves>>)
armor_unpack gloves
endif
if !(<isempty <tag.chest>>)
armor_unpack chest
endif
if !(<isempty <tag.legs>>)
armor_unpack legs
endif
if !(<isempty <tag.helm>>)
armor_unpack helm
endif
if !(<isempty <tag.collar>>)
armor_unpack collar
endif
if (<def.pack_deed_remove> == 1)
remove
return 1
else
tag.packed=
tag0.armor=0
color=pack_deed_color
name=armor packing deed
return 1
endif
endif
src.smsg Please target each piece of armor you would like to pack.
src.smsg Cancel targetting when you are done if the set is complete and less than a full set.
target
return 1
on=@TargOn_Item
// If the target is the deed and something was added we are going to finish the deed.
if (<argo.baseid> == i_armor_packing_deed)
if (<tag0.armor> > 0)
src.smsg You have completed the deed.
color=pack_deed_color_complete
name=armor packing deed [complete]
tag.packed=1
return 1
endif
endif
// Check to be sure it is in the backpack.
if (<argo.cont> != <src>)
src.smsg You may only pack armor that is in your backpack.
return 1
endif
// If we are not armor it is time to try again.
if (<argo.isarmor> != 1)
src.smsg You may only pack armor with this deed.
src.smsg Please choose an armor piece.
target
return 1
endif
if (<argo.layer> == layer_arms)
pack_armor arms
elif (<argo.layer> == layer_chest)
pack_armor chest
elif (<argo.layer> == layer_gloves)
pack_armor gloves
elif (<argo.layer> == layer_legs)
pack_armor legs
elif (<argo.layer> == layer_helm)
pack_armor helm
elif (<argo.layer> == layer_collar)
pack_armor collar
endif
[function unpack_armor]
args=<tag.<args>>
serv.newitem=<argv[0]>
new.color=<argv[1]>
new.more1l=<argv[2]>
new.more1h=<argv[3]>
new.attr=<argv[4]>
new.bounce
[function pack_armor]
// pack_armor legs
if (<tag.armor> &pack_<args>)
src.smsg You already have a <args> piece packed.
target
return 1
endif
tag.<args>=<argo.id>,<argo.color>,<argo.more1l>,<argo.more1h>,<argo.attr>
argo.remove
tag0.armor |pack_<args>
if (<tag0.armor> &03F)
src.smsg You have completed the deed.
color=pack_deed_color_complete
name=armor packing deed [complete]
tag.packed=1
return 1
else
src.smsg Please choose the next piece of armor to pack. Target the deed if you are done.
target
return 1
endif
[defname armor_packing_flags]
pack_arms 01
pack_chest 02
pack_gloves 04
pack_legs 08
pack_helm 010
pack_collar 020
[defname armor_packing_controls]
pack_deed_color 020 // base color.
pack_deed_color_complete 030 // completed color.
pack_deed_remove 0 // 0 dont remove, 1 remove after use.
pack_armor_strict 0 // 1 on and 0 off.
[eof]
If there is any issues let me know and I will correct it. But damn that is awesome looking. You are welcome for like an hour of my life (not really, time is accurate; but I was talking to XuN the entire time too; so really 15 minutes). lol!
(This post was last modified: 12-29-2013 08:00 AM by Khaos.)
|
|
12-29-2013 05:38 AM |
|
|