This class is root class for all beeings. Beeing can be payers persons, enemies and NPC. All of themhave same parameters, can fight each other, etc.
add (name, value) - Enables to add points to person basic parameters.
addEffect (id, modificator, duration, icon, canAct) - Adds active effect to person.
addExp (points) - Adds points to expirience just for this person.
addSpell (name) - Add spell to person without checking if its valid or not. Returns true if spell wasn't in spell book.
arms - Returns item on arms.
canAct - Returns if beeing can act is alive and not paralized or sleeping or what ever.
chest - Returns item on chest.
exists - Returns beeing fight exists.
foots - Returns item on foots.
get (name) - Returns value of parameter.
getResists (name) - Returns resist of beeing.
getSkill (name) - Returns skill of beeing.
getSpellBookName - Return name of spell book which use this beeing to cast spells. return text
group - Returns groups of monsters.
hand - Returns item in hand.
hasEffect (id) - Detect if beeign has effect.
hasSpell (name) - Returns if beeing has this spell.
head - Returns item on head.
hurt (how) - Hurt person for "how" points.
isAlive - Returns if beeing is alive.
isDeath - Returns if beeing is death.
isMonster - Returns if beeing is monster.
isNPC - Returns if beeing is NPC.
isPerson - Returns if beeing is person.
items - Persons items.
lefthand - Returns item in left hand.
legs - Returns item on legs.
makeLeader - Make beeing leader of group. Usable only for persons.
pos - Beeings position in group.
remove (name, value) - Enables to remove points from person basic parameters.
removeEffect (id, points) - Remove effect.
removeNativeEffect (id, [duration) - Remove one of native effects.
righthand - Returns item in right hand.
set (name, value) - Sets value of parameter.
setSkill (name, value) - Sets skill of beeing.
target - Returns target beeing in fight
tryNativeEffect (id, power, duration) - Tries attack with one of game native effect.
visualEffect (which, text) - Shows visual effect "which" on beeing and say "text".
add (name, value) Enables to add points to person basic parameters. For access main game values of person as HP,SP,EXP,INT, etc., you must use this function. It do standart handling of points with related events, which are connected to it.
Parameters name - name of parameter
value - how many points should be added
addEffect (id, modificator, duration, icon, canAct) Adds active effect to person. This is very important thing. Every effect, as sleep, poison, etc., is created by this function. It register it in persons Effect list. When you call addEffect with same "id" more time it adds "duration" to previous effect. Examples:
caster.addEffect("NICEGUY","CHA+4;STR-1",50,"nice");
This create new effect on caster. Name of effect will be take from names.dd2 by key NICEGUY. It change casters Charisma +4, but decrease his strenght -1. Duration will be 50 rounds. This effect will be represented by icon images/basic/effects<br>ice.gif. leader.addEffect("PARALYZE","",80/leader.getResist("EARTH"),"paralyze",0);
This create new effect on leader. Duration is 80/person's resistance to earth (hope that his resistance isn't 0). Better is use some function for generating random number in dependenci of resistance value. Person can't act. leader.addEffect("STONE","AC+50",-1,"stone",0);
This create new effect on leader. Duration -1 means that this effect naturally doesn't disappear, but must be removed by removeEffect function (probably by some spell or magic item). Person can't act, but has natural arrmor class +50 (he is stoned ;)).
Parameters id - defines unique id of effect.
modificator - defines change of values when this effect is acctive
duration - how log will this effect stay active
icon - picture of effect
canAct - true/false (1/0), if not entered = true
see
addExp (points) Adds points to expirience just for this person.
Parameters
addSpell (name) Add spell to person without checking if its valid or not. Returns true if spell wasn't in spell book.
Parameters
Returns
arms Returns item on arms.
Returns
canAct Returns if beeing can act - is alive and not paralized or sleeping or what ever.
Returns
chest Returns item on chest.
Returns
exists Returns beeing fight exists.
Returns
foots Returns item on foots.
Returns
get (name) Returns value of parameter.
Parameters
Returns
getResists (name) Returns resist of beeing.
Parameters
Returns
getSkill (name) Returns skill of beeing.
Parameters
Returns
getSpellBookName Return name of spell book which use this beeing to cast spells. return text
group Returns groups of monsters. If beeing is persons returns
party.class
. This is important, because when you want to use defined type in function head, it can make problems. For example:
function test(group $a) {
echo($a:class);
}
test(actor:group);
will work only when actor is monster. Otherwise there should be 'party' type.
Returns
hand Returns item in hand. For example when you have some script in item.onUse and there is
actor.hand.drop;
it will work, because ivery item, before it's used, must be picked up by person and then is used.
Returns
hasEffect (id) Detect if beeign has effect.
Parameters
see
hasSpell (name) Returns if beeing has this spell.
Parameters
Returns
head Returns item on head.
Returns
hurt (how) Hurt person for "how" points.
Parameters how - count of hurting points
isAlive Returns if beeing is alive.
Returns
isDeath Returns if beeing is death.
Returns
isMonster Returns if beeing is monster.
Returns
isNPC Returns if beeing is NPC.
Returns
isPerson Returns if beeing is person.
Returns
items
lefthand Returns item in left hand.
Returns
legs Returns item on legs.
Returns
makeLeader Make beeing leader of group. Usable only for persons.
Returns
pos Beeings position in group.
Returns
remove (name, value) Similar to add.
Parameters name - name of parameter
value - how many points should be removed
see
removeEffect (id, points) Remove beeings's effect. If "points" are entered then it decrease "points" from duration of effect "id". If duration is under 0, it disapeared. When there is only paramater "id" it complete remove effect. Examples:
leader.removeEffect("PARALYZE",10)
Removes 10 points of leader's paralyze effect. leader.removeEffect("STONE")
Removes effect stone.
Parameters id - id of effect
points - points of duration - not req.
see
removeNativeEffect (id, [duration)
Parameters id - of effect
[duration - to remove, default=all]
see
righthand Returns item in right hand.
Returns
set (name, value) Sets value of parameter.
Parameters name - of parameter
value - of parameter
setSkill (name, value) Sets skill of beeing.
Parameters name - of skill
value - of skill
target Returns target beeing in fight
Returns
tryNativeEffect (id, power, duration) Tries attack with one of game native effect. Duration of effect is dicreased by beeing's resistance against effects element. Actually there are these effects :
0 - poison - periodically hurst
1 - stone - can't act, permanent
2 - disease - decrease STR -2
3 - blind - ACU=0
4 - confusion - attack randomly
5 - sleep - can't act
Parameters id - of effect
power - of effect
duration - of effect [default=power*5]
see
visualEffect (which, text) Shows visual effect "which" on beeing and say "text".
Parameters which - id of visual effect 1-hit,2-poison,3-desease,4-magic
text - which is displayed in messages list
Generated by Hideoshi's Documentation Tool on 28.10.2003 20:08:52