"Mark A. Heilpern" wrote: > Right now I'm away from the "clean" DG Scripts source, and I don't know > off hand if this was added for pl6 or is a pre-pl7 snippet. The code below, > which comes from dg_scripts.c (after the #ifdef RACE/#endif block) will > let "%actor.fighting%" be used to determine if the character is engaged in > combat. > > else if (!str_cmp(field, "fighting")) > if (FIGHTING(c)) > sprintf(str, "%c%ld", UID_CHAR, GET_ID(FIGHTING(c))); > else *str = '\0'; Hrm... ya, I've used the %actor.fighting% variable with weapons/objects that require a command to be activated. I used: if (%actor.fighting% != ) dg_cast 'lightning' %actor.fighting% end I guess I wasn't clear in my last post, what I was trying to do was find a way so that the 'random' trigger will do basically the same thing. There is no '%actor%' for 'random' however, so I don't know how I would find out who/if the wielder is fighting or not. How about an '%owner%' variable that would be whoever is holding/wielding/wearing the object? Or is there already something like that which I haven't found? > > This is certainly interesting and something I was unaware of. The reason > is wield is in different code than wear. In people's opinion, should objects > have a wield trigger, or should the wear trigger be used for wield as well? > If people tell me what they think, I'll do something for pl7. Wield would help, it would be useful for making cursed weapons that can't be removed and so forth. I worked around this with a set of I think 2 triggers, but its a little messy. First there was an action trigger for when the person entered 'wield object', which would give a little flavour text blurb then create a variable and global it as well as start a timer. The same trigger would then force the wearer to wield object again, but this time it would bypass the flavour text because of the global. Finally a timer trigger reset the global after 1 minute so that anyone else wielding the same object would get the text again. Hrmm... that was probably confusing but like I said, its messy :) I might be able to clean it up a little with context but I have no clue how that works. Oh, I've also had some strange things happen with wear/remove triggers... about a minute or 2 after a person wears an object the remove trigger will activate followed immediately with the wear trigger again. This has happened only with the wear/remove trigger, a command trigger which is set to do the same thing won't activate. +------------------------------------------------------------+ | Ensure that you have read the CircleMUD Mailing List FAQ: | | http://qsilver.queensu.ca/~fletchra/Circle/list-faq.html | +------------------------------------------------------------+
This archive was generated by hypermail 2b30 : 12/15/00 PST