 |
harley Apprentice
Joined: 05 Apr 2008 Posts: 121
|
Posted: Fri Nov 21, 2008 10:13 pm
Help with a trigger |
Hey all.. I'm trying to create a trigger that will give me the total 'points' of an item when i identify it
This is what will be triggering it off of
| Code: |
id skin[code]
+-----------------------------------------------------------------+
| Keywords : skinned cloak a cornugon |
| Name : a protective cloak skinned from a cornugon |
| Type : Armor Level : 201 |
| Worth : 100 Weight : 10 |
| Wearable : neck |
| Flags : unique, glow, hum, magic, held, solidified, |
| : resonated, illuminated, V3, recharged |
| Notes : Item has 5 resistance affects. |
+-----------------------------------------------------------------+
| Stat Mods : Strength : +13 Dexterity : +4 |
| Wisdom : +9 Constitution : +12 |
| Intelligence : +10 Luck : +2 |
| Damage roll : +1 |
+-----------------------------------------------------------------+
[/code] |
the stat mods are what is important to me along with the Wearable, the level and the Name/Keywords, also perhaps the illuminated/resonated/solidified/recharged flags.
ok I just cant figure what to trigger on, i was thinking of doing the withinlines paramater, but i dont know how to do that.
Id like it to be able to be called from an alias so i can put it to a certain channel, ie. ide skin gt
would put the report of that idenfity on gt
the possible stat mods are as follows
| Code: |
| Strenth/Dexterity/Wisdom/Constitution/Intelligence/Luck/Damage roll/Hit roll |
the str/dex/wis/con/luck/int all count for 1 point
while hitroll/damroll count for .5 points each.
I do have onprompt event set up so if want to use that, can do that, just dont know how to use it from within a trigger.
Thanks guys.. [/code] |
|
|
|
 |
Vijilante SubAdmin

Joined: 18 Nov 2001 Posts: 5187
|
Posted: Fri Nov 21, 2008 11:12 pm |
This is off the top of my head, but should do most of what you are looking for.
| Code: |
#CLASS ID
#VAR ItemID {} {}
#ONINPUT "idtrig" {^id} {}
#COND {^| Wearable%s: (%w)} {ItemId=%concat("Wear=",%1)}
#COND {^| Stat Mods%s:(*)|} {ItemId=%concat(@ItemId,"|",%1)}
#COND {} {#IF (%begins(%line,"+")) {ItemID=%subchar(@ItemId," :+", "|=");ItemID=%subregex(@ItemID,"\|([\w ]+=)(\d+)","|\1\2(?($)Points=%eval((?(*)\2/%numwords(\1)+)0))");#DELITEM ItemId {};#SHOW @ItemId;#STATE idtrig 0} {ItemId=%concat(@ItemId,%line)}} "looplines|param=10"
#CLASS 0 |
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
 |
charneus Wizard

Joined: 19 Jun 2005 Posts: 1876 Location: California
|
Posted: Sat Nov 22, 2008 12:56 am |
If you look for my auction script in the package library, you can fiddle around with that a little. The script itself counts total stats, but it is easily adaptable to count points.
Charneus |
|
|
|
 |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|