From: tomtt <to...@us...> - 2007-07-31 01:01:17
|
Update of /cvsroot/planeshift/planeshift/src/server In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30812 Modified Files: progressionmanager.cpp Log Message: Added syntax and exmaple comments to script operators for extract to settings. Please add these types of comments when new operators are added or old ones are changed. Index: progressionmanager.cpp =================================================================== RCS file: /cvsroot/planeshift/planeshift/src/server/progressionmanager.cpp,v retrieving revision 1.298 retrieving revision 1.299 diff -C2 -d -r1.298 -r1.299 *** progressionmanager.cpp 29 Jun 2007 18:03:08 -0000 1.298 --- progressionmanager.cpp 31 Jul 2007 01:01:17 -0000 1.299 *************** *** 242,251 **** /*-------------------------------------------------------------*/ ! /** Used to create a change in character traits. * This is used to change a character's appearance live in game. * It takes the trait ID number and sends a broadcast out to all * the players in range about the change. * ! * A Trait op is simply <trait value="key into traits table" /> * * On the Run it checks to make sure the selected trait is allowed --- 242,257 ---- /*-------------------------------------------------------------*/ ! /** TraitChangeOp ! * Used to create a change in character traits. * This is used to change a character's appearance live in game. * It takes the trait ID number and sends a broadcast out to all * the players in range about the change. * ! * Syntax: ! * <trait value="#"/> ! * value = "#" index id key into traits table ! * Examples: ! * You apply trait 100 (grey hair) to actor and send message: ! * <trait value="100" /><msg aim="actor" text="You drop the liquid on your hair."/> * * On the Run it checks to make sure the selected trait is allowed *************** *** 312,318 **** --- 318,332 ---- }; + /*-------------------------------------------------------------*/ /** + * ExperienceOp * Adjust the experience of the target. + * + * Syntax: + * <exp type="allocate_last" value="#"/> + * allocate_type = "allocate_last" means allocate damage last otherwise damage is allocated + * value = "#" ammount of experience to give single player or share with others + * */ class ExperienceOp : public ProgressionOperation *************** *** 473,477 **** --- 487,498 ---- /** + * FactionOp * Adjust the faction of the actor relative to the target. + * + * Syntax: + * <faction aim="target" name="%s" value="#" /> + * aim = "target" adjust actor relative to target + * name = "%s" faction name + * value = "#" amount to adjust faction */ class FactionOp : public ProgressionOperation *************** *** 559,563 **** --- 580,610 ---- /** + * StatsOp * Adjust the specified stat of the target. + * + * Syntax: + * <HP|MANA|PSTAMINA|MSTAMINA|STR|AGI|END|INT|WIL|CHA|CON|STA|ATTACK|DEFENSE|HPRATE + * aim="target" adjust="set|add|mul|pct" base="yes" delay="#" undomsg="%s" value="#"/> + * HP = hit points, MANA = mana points, PSTAMINA = physical stamina, MSTAMINA = magical stamina, + * STR = strength, AGI = agility, END = endurance, INT = intelligence, WIL = will, CHA = charisma, + * CON = constitution, STA = stanima, ATTACK = attack modifier, DEFENSE = defense modifier, + * HPRATE = hit point recovery rate + * aim = "target" adjust target + * adjust = "set" set this attribute to the given value + * adjust = "add" add given value to this attribute + * adjust = "mul" mutliply attibute by given value + * adjust = "pct" apply the value as percentage to the attribute + * base = "yes" apply to base value + * delay = "#" ammount of time before attibute returns to normal + * undomsg = "%s" message player gets when attibute returns to normal + * value = "#" the ammount used to adjust attribute + * Example: + * The effect of energy arrow to reduce target 5 HP: + * <hp aim="target" value="-5"/><msg text="You deal 5HP damage."/> + * Taking the path of a street warrior adds 35% of character points to strength: + * <str adjust="add" value="0.35*CharPoints" /> + * Effect of darkness spell on actor is to reduce attack modifier by mutiplying by 1 minus 2% of powerlevel + * <attack adjust="mul" aim="target" value="1-0.02*PowerLevel" delay="10000*PowerLevel" + * undomsg="Your vision clears as the globe of darkness fades." /> */ class StatsOp : public ProgressionOperation *************** *** 967,971 **** --- 1014,1033 ---- /** + * SkillOp * Adjust the specified skill level of the target. + * + * Syntax: + * <skill name="%s" buff="no" aim="target" adjust="set" value="#" /> + * name = "%s" skill name + * buff = "no" no buff + * aim = "target" adjust target + * adjust = "set" set skill value as opposed to adjust + * value = "#" value to set skill + * Examples: + * Increase skill "Red Way" by 2 for 120 seconds and give message when potion wears off + * <skill name="Red Way" value="2" delay="120000" aim="actor" attribute="adjust" base="no" + * undomsg="The potion wears off." /> + * An item increases the herbal skill by 3 with no buf: + * <skill name="herbal" buff="no" attribute="adjust" value="3"/> */ class SkillOp : public ProgressionOperation *************** *** 1118,1123 **** /** * Send a message to the target OR the actor. ! */ class MsgOp : public ProgressionOperation { --- 1180,1195 ---- /** + * MsgOp * Send a message to the target OR the actor. ! * ! * Syntax: ! * <msg aim="target" text="%s" /> ! * aim = "target" send message to target instead of actor ! * text = "%s" text to send ! * Examples: ! * Send message to actor and target about spell effects: ! * <msg aim="actor" text="You fire sharp ice blades from your fingers, hurting your opponents."/> ! * <msg aim="target" text="You are hit by sharp ice blades."/></area> ! */ class MsgOp : public ProgressionOperation { *************** *** 1235,1240 **** --- 1307,1326 ---- /** + * BlockOp * Block a category of spells from being recast again for a * specified time delay. + * + * Syntax: + * <block operation="BLOCK_ADD" category="%s" delay="#" /> + * operation = "BLOCK_ADD" add the blocking otherwise remove it + * category = "%s" catagory of spell to block + * delay = "#" amount of time to block spells + * Examples: + * Blocks the cast of weakness protection spell for 2 plus 5 times PowerLevel seconds + * <block category="-Weakness" delay="2000+5000*PowerLevel" /> + * Blocks the cast of darkness protection for 10 times PowerLeven seconds + * <block category="-Darkness" delay="10000*PowerLevel" /> + * Blocks taking another Red potion for 120 seconds + * <block category="PotionRed" delay="120000" /> */ class BlockOp : public ProgressionOperation *************** *** 1351,1355 **** --- 1437,1454 ---- /** + * AttachScriptOp * Attach scripts reacting on gemActor events to a gemActor + * + * Syntax: + * <attachscript aim="target" delay="#" scriptName="%s" event="attack" undomsg="%s" /> + * aim = "target" attach to target instead of actor + * delay = "#" ammount of time to have script attached + * scriptName = "%s" name of progression script to attach + * event = "attack" attach attack scripts otherwise they are damage scripts + * undomsg = "%s" message to send when attachment is finished + * Examples: + * Cast a Flame Spire spell by running defensive damage script "apply Flame Spire" for 2 times PowerLevel seconds + * <attachscript aim="actor" delay="2000+PowerLevel" scriptName="apply Flame Spire" event="defense" + * undomsg="The flame spire disappears."/> */ class AttachScriptOp : public ProgressionOperation *************** *** 1438,1442 **** --- 1537,1548 ---- /** + * DetachScriptOp * Detach scripts reacting on gemActor events from a gemActor + * + * Syntax: + * <detachscript aim="target" scriptID="#" event="attack" /> + * aim = "target" detach from target rather then actor + * scriptID = "#" the index number of the script to detach + * event = "attack" detach attack scripts rather then damage scripts */ class DetachScriptOp : public ProgressionOperation *************** *** 1508,1512 **** --- 1614,1622 ---- /** + * IdentifyMagicOp * Determine if 'target' is magical item and tell 'actor' the outcome + * + * Syntax: + * <identifymagic/> */ class IdentifyMagicOp : public ProgressionOperation *************** *** 1571,1575 **** --- 1681,1695 ---- /** + * ScriptOp * Queue another named script to run after a specifed delay. + * + * Syntax: + * <script delay="#" persistent="yes" >%s</script> + * delay = "#" amount of time to delay before running script + * persistant = "yes" will create a persistant event verses a temporary one + * %s = the script to que up to run + * Examples: + * Queue an event to give actor 5 more HP and messages after 3 seconds: + * <script delay="3000"><hp value="5"><msg text="You feel fresh"/></script> */ class ScriptOp : public ProgressionOperation *************** *** 1621,1634 **** /*-------------------------------------------------------------*/ - /* Applies a script to everything of a type in an area. */ - /* Syntax: */ - /* <area type="entity|item|actor|group|hostile|friendly" */ - /* range="#" */ - /* anglerange="#" (in degrees) */ - /* delaybetween="#" (in ms; default all at once) */ - /* includetarget="yes|no" > (default yes) */ - /* script */ - /* </area> */ class AreaOp : public ProgressionOperation { --- 1741,1771 ---- /*-------------------------------------------------------------*/ + /** + * AreaOp + * Applies a script to everything of a type in an area. + * + * Syntax: + * <area type="entity|item|actor|group|hostile|friendly" range="#" anglerange="#" + * delaybetween="#" includetarget="yes|no" > %s </area> + * type = "entity" apply to everything + * type = "item" apply to items only + * type = "actor" apply to actor + * type = "group" apply to actor's group + * type = "hostile" apply to all that actor can attack + * type = "friendly" apply to all the actor can not attack + * range = "#" range in m of area + * anglerange = "#" angle of effect in degrees + * delaybetween = "#" delay in ms default to all at once + * includetarget = "no" include target or not + * %s script to apply to everything of a type in area + * Examples: + * Cast Icy Blast on all all mobs within 12 by applying script to reduce HP by 2 plus PowerLevel for Powerlevel seconds + * <area type="hostile" range="12"> + * <hp adjust="add" aim="target" value="-1*(2+PowerLevel)" delay="1000*PowerLevel"/> + * <msg aim="actor" text="You fire sharp ice blades from your fingers, hurting your opponents."/> + * <msg aim="target" text="You are hit by sharp ice blades."/></area> + * + */ class AreaOp : public ProgressionOperation { *************** *** 1862,1865 **** --- 1999,2016 ---- /*-------------------------------------------------------------*/ + /** + * ItemOp + * Create item or money + * + * Syntax: + * <item name="%s" location="wallet|inventory|ground" aim="target" count="#" /> + * name = "%" item name + * location ="wallet" name must be "trias","hexas","octas", or "circles" + * location ="inventory" put item directly into inventory + * location ="ground" put item onto ground + * Examples: + * Drop a stack of 5 longswords on the groud at the foot of the targeted player: + * <item aim="target" name="Longsword" location="ground" count="5" /> + */ class ItemOp : public ProgressionOperation { *************** *** 2028,2031 **** --- 2179,2190 ---- /*-------------------------------------------------------------*/ + /** + * PurifyOp + * Purify a glyph + * + * Syntax: + * <purify glyph="#" /> + * glyph = "#" glyph ID + */ class PurifyOp : public ProgressionOperation { *************** *** 2076,2083 **** /*-------------------------------------------------------------*/ - /* Syntax: */ - /* <morph mesh="" duration="#" /> */ - /* (set mesh to "reset" to reset) */ class MorphOp : public ProgressionOperation { --- 2235,2248 ---- /*-------------------------------------------------------------*/ + /** + * MorphOp + * Morph an actor's mesh + * + * Syntax: + * <morph mesh="%s" duration="#" /> + * mesh = "%s" is the new mesh for actor + * duration is amount of time before making the change + */ class MorphOp : public ProgressionOperation { *************** *** 2128,2140 **** /*-------------------------------------------------------------*/ - /* The quest operator only has one function at the moment */ - /* The complete function checks for quest completion */ - /* Complete Syntax: */ - /* <quest funct="complete" aim=target_str */ - /* prerequisite=quest_str /> */ - /* target_str = target to apply quest operation */ - /* quest_str = quest to check target has completed */ - /* result = non-zero if quest is completed */ enum QuestOpFunctions { --- 2293,2314 ---- /*-------------------------------------------------------------*/ + /** + * QuestOp + * The quest operator only has one function at the moment + * The complete function checks for quest completion + * + * Syntax: + * <quest funct="complete" aim="target" prerequisite="%s" + * funct = "complete" checks if quest has been completed + * aim = "target" will check target otherwise actor is checked + * prerequisite = "%s" quest name to check target has completed + * Example: + * Check if actor has completed the Rescue the Princess quest and give message: + * <quest funct="complete" aim="actor" prerequisite="Rescue the Princess" /> + * <msg aim="actor" text="You are trying to access restricted area."/> + * + * For complete function result = 1 if quest is completed otherwise 0 + */ enum QuestOpFunctions { *************** *** 2249,2261 **** /*-------------------------------------------------------------*/ ! /* At this point there is only one function for this script */ ! /* The activate function activates any inactive entrance action*/ ! /* location of the specified entrance type and places into */ ! /* players inventory a key for the lock instance ID defined */ ! /* in that action location entrance. */ ! /* Activate Syntax: */ ! /* <action funct="activate" sector=sector stat=keystat_name /> */ ! /* sector = sector string to use to search for entrance */ ! /* keystat_name = name of item type to new key for lock */ enum ActionOpFunctions { --- 2423,2444 ---- /*-------------------------------------------------------------*/ ! ! /** ! * ActionOp ! * At this point there is only one function for this script ! * The activate function activates any inactive entrance action ! * location of the specified entrance type and places into ! * players inventory a key for the lock instance ID defined ! * in that action location entrance. ! * ! * Syntax: ! * <action funct="activate" sector="%s" stat="%s" /> ! * funct="activate" activates action location ! * sector = "%s" sector string to qualify search for inactive entrances ! * stat = "%s" name of item type for new key for lock ! * Examples: ! * This quest script activates the any inactive action location for sector guildlaw and give a "Small Key" item. ! * <action funct="activate" sector="guildlaw" stat="Small Key" /> ! */ enum ActionOpFunctions { *************** *** 2377,2394 **** /*-------------------------------------------------------------*/ - /* There are two functions of this script. The make function */ - /* will create a new key for the specified lock. The modify */ - /* fucntion will change existing key to work with lock. */ - /* Make syntax: */ - /* <key funct="make" lockID=lock_num stat=keystat_name */ - /* location="inventory"|"ground" /> */ - /* location = put new key in inventory or ground */ - /* lock_num = instance ID of lock to associate with key */ - /* keystat_name = name of item type to new key for lock */ - /* Modify syntax: */ - /* <key funct="modify" lockID=lock_num keyID=key_num /> */ - /* lock_num = instance ID of lock to associate with key */ - /* key_num = instance ID of key to associate with lock */ enum KeyOpFunctions { --- 2560,2585 ---- /*-------------------------------------------------------------*/ + /** + * KeyOp + * There are two functions of this script. The make function + * will create a new key for the specified lock. The modify + * fucntion will change existing key to work with lock. + * + * Syntax: + * <key funct="make" lockID="#" stat="%s" location="inventory"|"ground" /> + * funct = "make" makes a key for specific lock + * lockID = "#" instance ID of lock to associate with key + * stat = "%s" name of item type to make a key for lock + * location = "inventory" put new key in actiors inventory + * location = "ground" put new key on groud + * <key funct="modify" lockID="#" keyID="#" /> + * funct = "modify" changes the key to work with specific lock + * lockID = "#" instance ID of lock to associate with key + * keyID = "#" instance ID of key to change to work with lock + * Example: + * Crate a new Small Key and change lock instance 75 to open with new key and put key into actors inventory: + * <key funct="make" lockID="75" stat="Small Key" location="inventory" /> + */ enum KeyOpFunctions { *************** *** 2554,2561 **** /*-------------------------------------------------------------*/ - /* Syntax: */ - /* <set attrib="invincible|invisible|nofalldamage|nevertired" */ - /* value="true|false" duration="#" /> (default true) */ class AttributeOp : public ProgressionOperation { --- 2745,2769 ---- /*-------------------------------------------------------------*/ + /** + * AttributeOp + * Set character game attributes + * + * Syntax: + * <set attrib="invincible|invisible|nofalldamage|nevertired" + * value="true|false" duration="#" /> + * attrib="invincible" set actor's invincibility in combat + * attrib="invisible" set actor's invisibility to visible characters + * attrib="nofalldamage" set actor's ability to be damaged from falls + * attrib="nevertired" set actors ability to be fatigued + * value = "true" makes above attributes true + * value = "false" makes above attributes false + * duration = "#" is how many seconds before attribute change undone otherwise permanent + * Examples: + * Set actors nofalldamage and never tired attributes for 120 seconds and send message: + * <set attrib="nofalldamage" duration="120" /> + * <set attrib="nevertired" duration="120" /> + * <msg text="Your legs feel more powerful!"/> + */ class AttributeOp : public ProgressionOperation { *************** *** 2642,2652 **** /*-------------------------------------------------------------*/ - /* Syntax: */ - /* <weather type="fog|rain|snow|lightning|auto" */ - /* sector="" (may list "this" for target's) */ - /* duration="#" density="#" fade="#" (seconds)*/ - /* r="#" g="#" b="#" (fog only) */ - /* enable="true|false" /> (true by default) */ class WeatherOp : public ProgressionOperation { --- 2850,2901 ---- /*-------------------------------------------------------------*/ + /** + * WeatherOp + * Change the weather in specified sector + * + * Syntax: + * <weather type="rain|snow" sector="this|%s" duration="#" + * density="#" fade="#" enable="true|false" /> + * type = "rain" causes rain + * type = "snow" causes snow + * sector = "this" use actor's sector map name + * sector = "%s" sector map name + * duration = "#" amount of time in seconds for weather to last + * density = "#" density of rain or snow 0 (light) to 6000 (snow) or 8000 (rain) + * fade = "#" amount of time in seconds to fade in 0 means no fade + * enable = "true" turn on weather + * enable = "false" turn off weather + * <weather type="lightning" sector="this|%s" duration="#" + * density="#" fade="#" enable="true|false" /> + * type = "lightning" causes lightning + * sector = "this" use actor's sector map name + * sector = "%s" sector map name + * duration = "#" amount of time in seconds for weather to last + * fade = "#" amount of time in seconds to fade in 0 means no fade + * enable = "true" turn on weather (default) + * enable = "false" turn off weather + * <weather type="fog" sector="%s" duration="#" + * fade="#" r="#" g="#" b="#" enable="true|false" /> + * type = "fog" causes fog + * sector = "this" use actor's sector map name + * sector = "%s" sector map name + * duration = "#" amount of time in seconds for weather to last + * fade = "#" amount of time in seconds to fade in 0 means no fade + * r = "#" the red color component of fog + * g = "#" the green color component of fog + * b = "#" the blue color component of fog + * enable = "true" turn on weather + * enable = "false" turn off weather + * <weather type="auto" sector="this|%s" enable="true|false" /> + * type = "auto" controls the default weather for sector + * sector = "this" use actor's sector map name + * sector = "%s" sector map name + * enable = "true" turn on weather + * enable = "false" turn off weather + * Examples: + * Cause rain effect for this secotr for 60 seconds with 10 second faid with highest density: + * <weather type="rain" sector="this" duration="60" fade="10" density="8000" /> + */ class WeatherOp : public ProgressionOperation { *************** *** 2872,2879 **** /*-------------------------------------------------------------*/ - /* Syntax: */ - /* <createpet masterids="##,##,##" - controlled="true|false" /> */ class CreatePetOp : public ProgressionOperation { --- 3121,3135 ---- /*-------------------------------------------------------------*/ + /** + * CreatePetOp + * Create pet for actor. + * + * Syntax: + * <createpet masterids="#|#,#,#,..." controlled="true|false" /> + * masterids = "#" specific pet ID + * masterids = "#,#,# ..." range of pet IDs to pick + * controlled = "true|false" not yet implimented + */ class CreatePetOp : public ProgressionOperation { *************** *** 2960,2967 **** /*-------------------------------------------------------------*/ ! /*-------------------------------------------------------------*/ ! /* Syntax: */ ! /* <createfamiliar /> */ ! class CreateFamiliarOp : public ProgressionOperation { --- 3216,3229 ---- /*-------------------------------------------------------------*/ ! /** ! * CreateFamiliarOp ! * Create familiar for actor. ! * ! * Syntax: ! * <createfamiliar/> ! * Examples: ! * Create and familiar near actor and send message: ! * <createfamiliar /><msg text="Your new familiar appears nearby."/> ! */ class CreateFamiliarOp : public ProgressionOperation { *************** *** 3018,3027 **** /*-------------------------------------------------------------*/ ! /*-------------------------------------------------------------*/ ! /* Syntax: */ ! /* <animalaffinity name="" ! attribute="adjust|set" ! value="##.##" /> */ ! class AnimalAffinityOp : public ProgressionOperation { --- 3280,3299 ---- /*-------------------------------------------------------------*/ ! /** ! * AnimalAffinityOp ! * Change anilma affinity. ! * ! * Syntax: ! * <animalaffinity name="%s" attribute="adjust|set" value="#" /> ! * name = "%s" animal name ! * attribute = "adjust" add new value to old affinity ! * attribute = "set" set attribute to new value ! * value = "#" floating point value to set affinity ! * Examples: ! * An item adds 3 to the animal affinity called "daylight": ! * <animalaffinity attribute="adjust" name="daylight" value="3"/> ! * An item adds 3 to the animal affinity called "reptile": ! * <animalaffinity attribute="adjust" name="reptile" value="3"/> ! */ class AnimalAffinityOp : public ProgressionOperation { *************** *** 3182,3185 **** --- 3454,3464 ---- /*-------------------------------------------------------------*/ + /** + * ShowDetailsOp + * Show actors character details. + * + * Syntax: + * <showdetails/> + */ class ShowDetailsOp : public ProgressionOperation { *************** *** 3236,3243 **** /*-------------------------------------------------------------*/ - /* Syntax: */ - /* <move type="reset|add|mod|const|push" */ - /* duration="#" x="#" y="#" z="#" yrot="#" /> */ class MovementOp : public ProgressionOperation { --- 3515,3537 ---- /*-------------------------------------------------------------*/ + /** + * MovementOp + * Create move modification for actor. + * + * Syntax: + * <move type="reset|add|mod|const|push" duration="#" + * x="#" y="#" z="#" yrot="#" /> + * type="reset" resets move modifiers + * type="add" add this to movements + * type="mod" multiply this with movements + * type="const" add this to velocity until duration over + * type="push" execute this movement once + * duration = "#" amount of ms before resetting modification 0 means never + * x = "#" change in x coord + * y = "#" change in y coord + * z = "#" change in z coord + * yrot = "#" change in yrot + */ class MovementOp : public ProgressionOperation { |