StendhalAPI: Difference between revisions
Jump to navigation
Jump to search
Content deleted Content added
imported>AntumDeluge →SpeakerNPC: add public methods |
imported>AntumDeluge add categories |
||
| (5 intermediate revisions by the same user not shown) | |||
| Line 396: | Line 396: | ||
{{PublicMethod | getKarma | params= | desc=Retrieves current karma level. | ret= | rettype=double | paramlist=}} |
{{PublicMethod | getKarma | params= | desc=Retrieves current karma level. | ret= | rettype=double | paramlist=}} |
||
{{PublicMethod | useKarma | params=scale | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | useKarma | params=negLimit, posLimit[, granularity] | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | heal | params=[amount[, tell]] | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addMana | params=mana, tell | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | damageDone | params=defender, attackingWeaponsValue, damageType | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setAtk | params=atk | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getAtk | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCappedAtk | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setAtkXP | params=atk | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addAtkXP | params=xp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getAtkXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | incAtkXP | params=def | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setDef | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getDef | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCappedDef | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setDefXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addDefXP | params=xp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getDefXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | incDefXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setRatk | params=ratk | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getRatk | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCappedRatk | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setRatkXP | params=xp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addRatkXP | params=xp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getRatkXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | incRatkXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | initHP | params=hp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setBaseHP | params=newhp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getBaseHP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setHP | params=hp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getHP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getLVCap | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getMana | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getBaseMana | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setMana | params=newMana | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setBaseMana | params=newBaseMana | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addBaseMana | params=newBaseMana | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setLVCap | params=newLVCap | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setXP | params=newxp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | subXP | params=newxp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addXP | params=newxp | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getXP | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | isAttackable | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setTarget | params=target | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | stopAttack | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getsFightXpFrom | params=enemy | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | stopAttacking | params=attacker | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | rememberAttacker | params=attacker | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setBlood | params=name | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getBloodClass | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getDroppables | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | dropDroppableItem | params=droppable | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | maybeDropDroppables | params=attacker | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | onDamaged | params=attacker, damage | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | damage | params=amount, attacker | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | delayedDamage | params=amount, attackerName | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | onDead | params=killer[, remove] | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCorpseName | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getHarmlessCorpseName | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCorpseWidth | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCorpseHeight | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | isInvisibleToCreatures | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | isAttacked | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getAttackSources | params= | desc=TODO | ret= | rettype=List<[[StendhalAPI#Entity|Entity]]> | paramlist=}} |
|||
{{PublicMethod | getAttackingRPEntities | params= | desc=TODO | ret= | rettype=List<[[StendhalAPI#RPEntity|RPEntity]]> | paramlist=}} |
|||
{{PublicMethod | isAttacking | params= | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | getAttackTarget | params= | desc=TODO | ret= | rettype=[[StendhalAPI#RPEntity|RPEntity]] | paramlist=}} |
|||
{{PublicMethod | equipToInventoryOnly | params=item | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | getSlotToEquip | params=item | desc=TODO | ret= | rettype=[[MarauroaAPI#RPSlot|RPSlot]] | paramlist=}} |
|||
{{PublicMethod | equipOrPutOnGround | params=item | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | equip | params=slotName, item | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | isEquipped | params=condition, amount | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | drop | params=<name> {{!|}} <item> | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | dropWithInfostring | params=name, infostring[, amount] | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | isEquipped | params=name[, amount] | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | isEquippedWithInfostring | params=name, infostring[, amount] | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | getNumberOfEquipped | params=name | desc=TODO | ret= | rettype=int | paramlist=}} |
|||
{{PublicMethod | getTotalNumberOf | params=name | desc=TODO | ret= | rettype=int | paramlist=}} |
|||
{{PublicMethod | getFirstEquipped | params=name | desc=TODO | ret= | rettype=[[StendhalAPI#Item|Item]] | paramlist=}} |
|||
{{PublicMethod | getAllEquipped | params=name | desc=TODO | ret= | rettype=List<[[StendhalAPI#Item|Item]]> | paramlist=}} |
|||
{{PublicMethod | getAllEquippedWithInfostring | params=name, infostring | desc=TODO | ret= | rettype=List<[[StendhalAPI#Item|Item]]> | paramlist=}} |
|||
{{PublicMethod | isEquippedItemClass | params=slot, clazz | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | isEquippedItemInSlot | params=slot, item | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | getEquippedItemClass | params=slot, clazz | desc=TODO | ret= | rettype=[[StendhalAPI#Item|Item]] | paramlist=}} |
|||
{{PublicMethod | getWeapon | params= | desc=TODO | ret= | rettype=[[StendhalAPI#Item|Item]] | paramlist=}} |
|||
{{PublicMethod | getWeapons | params= | desc=TODO | ret= | rettype=List<[[StendhalAPI#Item|Item]]> | paramlist=}} |
|||
{{PublicMethod | getRangeWeapon | params= | desc=TODO | ret= | rettype=[[StendhalAPI#Item|Item]] | paramlist=}} |
|||
{{PublicMethod | getAmmunition | params= | desc=TODO | ret= | rettype=[[StendhalAPI#StackableItem|StackableItem]] | paramlist=}} |
|||
{{PublicMethod | getMissileIfNotHoldingOtherWeapon | params= | desc=TODO | ret= | rettype=[[StendhalAPI#StackableItem|StackableItem]] | paramlist=}} |
|||
{{PublicMethod | hasShield | params= | desc=TODO | ret= | rettype=boolean | paramlist=}} |
|||
{{PublicMethod | getShield | params= | desc=TODO | ret= | rettype=[[StendhalAPI#Item|Item]] | paramlist=}} |
|||
{{PublicMethod | hasArmor | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getArmor | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasHelmet | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getHelmet | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasLegs | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getLegs | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasBoots | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getBoots | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasCloak | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCloak | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasRing | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getRing | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | sendPrivateText | params=text | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | sendPrivateText | params=type, text | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getItemAtk | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getItemRatk | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getItemDef | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getDefenseItems | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | updateItemAtkDef | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | canDoRangeAttack | params=target, maxrange | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasLineOfSight | params=target | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getMaxRangeForArcher | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setTitle | params=title | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | logic | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | canHit | params=defender | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getAtkRate | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | attack | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | handleLifesteal | params=attacker, attackerWeapons, damage | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getCorpseDeserver | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getLanguage | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setDeathSound | params=sound | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getDeathSound | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | addStatusAttacker | params=statusAttacker | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getStatusList | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | hasStatus | params=statusType | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setShadowStyle | params=st | desc=TODO | ret= | rettype= | paramlist=}} |
|||
'''Static public methods:''' |
'''Static public methods:''' |
||
{{PublicMethod | generateRPClass | params= | desc= | ret= | rettype= | paramlist=}} |
{{PublicMethod | generateRPClass | params= | desc= | ret= | rettype= | paramlist=}} |
||
{{PublicMethod | applyDistanceAttackModifiers | params=damage, squareDistance, maxrange | desc=TODO | ret= | rettype= | paramlist=}} |
|||
== DressedEntity == |
== DressedEntity == |
||
| Line 405: | Line 661: | ||
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/DressedEntity.java|games.stendhal.server.entity.DressedEntity}} ''(abstract)'' |
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/DressedEntity.java|games.stendhal.server.entity.DressedEntity}} ''(abstract)'' |
||
* Inherits: [[StendhalAPI#RPEntity|RPEntity]] |
* Inherits: [[StendhalAPI#RPEntity|RPEntity]] |
||
'''Public Methods:''' |
|||
{{PublicMethod | DressedEntity | params= | desc=Default constructor. | ret=New instance. | rettype=[[StendhalAPI#DressedEntity|DressedEntity]] | paramlist=}} |
|||
{{PublicMethod | DressedEntity | params=object | desc=Copy constructor. | ret=New instance. | rettype=[[StendhalAPI#DressedEntity|DressedEntity]] | paramlist= |
|||
{{MethodParam | object | type=[[MarauroaAPI#RPObject|RPObject]] | desc=Object to be copied.}} }} |
|||
{{PublicMethod | getOutfit | params= | desc=TODO | ret= | rettype=[[StendhalAPI#Outfit|Outfit]] or null | paramlist=}} |
|||
{{PublicMethod | getOriginalOutfit | params= | desc=TODO | ret= | rettype=[[StendhalAPI#Outfit|Outfit]] or null | paramlist=}} |
|||
{{PublicMethod | getOutfitColors | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfit | params=outfit[, temporary] | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfit | params=layers | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfit | params=temporary, layers | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfit | params=strcode[, temporary] | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfitWithDetail | params=outfit, temporary | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfitColor | params=part, color | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setOutfitColors | params=parts | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | isNaked | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | unsetOutfitColor | params=part | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | restoreOriginalOutfit | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
== NPC == |
== NPC == |
||
| Line 410: | Line 699: | ||
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/npc/NPC.java|games.stendhal.server.entity.npc.NPC}} ''(abstract)'' |
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/npc/NPC.java|games.stendhal.server.entity.npc.NPC}} ''(abstract)'' |
||
* Inherits: [[StendhalAPI#DressedEntity|DressedEntity]] |
* Inherits: [[StendhalAPI#DressedEntity|DressedEntity]] |
||
'''Public Members:''' |
|||
{{PublicMember | pauseTurnsRemaining | desc=| type=int}} |
|||
'''Public Methods:''' |
|||
{{PublicMethod | NPC | params= | desc=Default constructor | ret=New instance. | rettype=[[StendhalAPI#NPC|NPC]] | paramlist=}} |
|||
{{PublicMethod | NPC | params=object | desc=Copy constructor. | ret=New instance. | rettype=[[StendhalAPI#NPC|NPC]] | paramlist= |
|||
{{MethodParam | object | type=[[MarauroaAPI#RPObject|RPObject]] | desc=Object to be copied.}} }} |
|||
{{PublicMethod | checkPause | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getIdea | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getMovementRange | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getPerceptionRange | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | getSounds | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | moveRandomly | params= | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | say | params=text | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setIdea | params=idea | desc=Sets the NPC's idea/thought. | ret= | rettype= | paramlist= |
|||
{{MethodParam | idea | type=String | desc=The idea mnemonic, or <code>null</code>.}} }} |
|||
{{PublicMethod | setMovement | params=destEntity, min, max, maxPathRadius | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setMovementRange | params=movementRange | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setPathCompletedPause | params=pause[, dir] | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setPerceptionRange | params=perceptionRange | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setRandomPathFrom | params=x, y, distance | desc=TODO | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setSounds | params=sounds | desc=TODO | ret= | rettype= | paramlist=}} |
|||
== PassiveNPC == |
== PassiveNPC == |
||
| Line 415: | Line 744: | ||
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/npc/PassiveNPC.java|games.stendhal.server.entity.npc.PassiveNPC}} ''(abstract)'' |
* Class: {{StendhalFile|master|src/games/stendhal/server/entity/npc/PassiveNPC.java|games.stendhal.server.entity.npc.PassiveNPC}} ''(abstract)'' |
||
* Inherits: [[StendhalAPI#NPC|NPC]] |
* Inherits: [[StendhalAPI#NPC|NPC]] |
||
'''Public Methods:''' |
|||
{{PublicMethod | createPath | params= | desc=Does nothing unless overridden by sub-class. | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | reversePath | params= | desc=Changes entity's path to walk in opposite direction. | ret= | rettype= | paramlist=}} |
|||
{{PublicMethod | setTeleportsFlag | params=teleports | desc=TODO | ret= | rettype= | paramlist= |
|||
{{MethodParam | teleports | type=boolean | desc=}} }} |
|||
{{PublicMethod | isTeleporter | params= | desc= | ret=teleports | rettype=boolean | paramlist=}} |
|||
== SpeakerNPC == |
== SpeakerNPC == |
||
| Line 546: | Line 886: | ||
* [[StendhalScripting|Stendhal Supported Scripting]] |
* [[StendhalScripting|Stendhal Supported Scripting]] |
||
[[Category:Documentation]] |
|||
[[Category:API]] |
|||
Latest revision as of 21:52, 18 January 2022
this page is a work-in progress
Description
This page is intended to be a description of the common usable methods for adding or altering the world of Stendhal.
Entities
Base Classes
Entity
This is the base entity class for all entities in Stendhal.
- Class: games.stendhal.server.entity.Entity
- Inherits: marauroa.common.game.RPObject
- Implements:
Public methods:
- Entity()
- Default constructor.
- Entity(object)
- Copy constructor.
- object: Object to be copied.
- setDescription(text)
- Sets the description text for the entity.
- text: String to be used for description.
- setEntityClass(clazz)
- Sets the "class" attribute which is used to determine an image to be used as a representation of this entity.
- clazz: (
String) Class name.
- setEntitySubclass(subclazz)
- Sets the "subclass" attribute which is used to determine an image to be used as a representation of this entity.
- subclazz: (
String) Sub-class name.
- setSize(width, height)
- Sets the entity's size.
- width: (
int) - height: (
int)
- setPosition(x, y)
- Sets the entity's horizontal & vertical position.
- x: (
int) The horizontal position. - y: (
int) The vertical position.
- setResistance(resistance)
- Sets the resistance this has with other entities.
- resistance: (
int) Amount of resistance to set (0-100).
- setVisibility(visibility)
- Sets the entity's visibility level.
- visibility: (
int)0= completely transparent,100= completely opaque.
- setMenu(menu)
- Sets the context menu to use for the entity.
- menu: (
String) The menu to display in the client in the format:
Display name 1|action1, Display name 2|action2
- setCursor(cursor)
- Sets the name of the mouse cursor that should be used for this entity.
- cursor: (
String)
- getTitle()
- Retrieves the entity's nicely formatted title/name.
- returns: (
String) The entity's formatted name.
- getName()
- Retrieves the name of this entity.
- returns: (
String) The entity's name.
- getDescription()
- Retrieves the entity's description text.
- returns: (
string) The entity's description text.
- getDescriptionName(definite)
- Retrieves the name or something that can be used to identify the entity to the player.
- definite: (
bool) Determines article to be used as prefix.truefor "the" &falsefor "a/an" in case the entity has no name. - returns: (
String) Entity name including article.
- getHeight()
- Retrieves the entity's height.
- returns: (
double)
- getWidth()
- Retrieves the entity's width.
- returns: (
double)
- getZone()
- returns: (
StendhalRPZone) The current zone where the entity is located.
- getX()
- returns: (
int) The horizontal coordinate of the entity's position.
- getY()
- returns: (
int) The vertical coordinate of the entity's position.
- getResistance(entity)
- Retrieves the resistance this entity has on other entities.
- entity: (optional) If set, returned value is combined resistance.
- returns: (
int) Value between 0-100 (0 = no resistance, 100 = non-traversable).
- getAdjacentNodes()
- Retrieves horizontal & vertical nodes immediately adjacent to entity's current position.
- NOTE: This does not compensate for the entity's size. It is only meant to determine the positions the entity could potentially move to.
- returns: (
List<Node>) All nodes next to entity.
- getArea()
- Retrieves the area this entity currently occupies.
- returns: (
Rectangle2D)
- getArea(ex, ey)
- ex: (
double) - ey: (
double) - returns: (
Rectangle2D)
- getOrigin()
- Retrieves the initial position of the entity.
- returns: (
Point)
- getEntitySlot(name)
- Retrieve's a slot identified by
name. - name: (
String) Name of slot. - returns: (
EntitySlot) EntitySlot instance ornullif the entity does not have such slot.
- getCursor()
- Retrieves the name of the mouse cursor that should be used for this entity.
- returns: (
String) Cursor name or null.
- stopped()
- returns: (
bool)trueif the entity is not moving.
- hasDescription()
- Checks if the entity has a description.
- returns: (
bool)trueif the "description" attribute is set.
- isObstacle(entity)
- Determine if this is an obstacle for another entity.
- entity: The entity to check against.
- returns: (
bool)trueif combined resistance is above 95.
- isInSight(other)
- Checks if another entity is close enough to be detected by this entity.
- other: (
Entity) The entity to gauge distance to. - returns: (
boolean)trueif near enough.
- squaredDistance(other)
- Retrieves the square distance between this entity & the given one.
- other: (
Entity) The entity to which the distance should be calculated. - returns: (
double) Representation of the squared distance.
- squaredDistance(x, y)
- Retrieves the square distance between this entity & a given point.
- x: (
int) The horizontal position to which distance should be calculated. - y: (
int) The vertical position to which distance should be calculated. - returns: (
double) Representation of the squared distance.
- nextTo(entity, step)
- Checks whether the given entity is next to this one.
- entity: (
Entity) The entity to compare distance to. - step: (
double) (default: 0.25) Maximum distance at which is required to determine if next to. - returns: (
bool)trueif entity is next to this one.
- onAdded(zone)
- Called when this entity is added to a zone.
- zone: (
StendhalRPZone) The zone this was added to.
- onRemoved(zone)
- Called when this entity is being removed from a zone.
- zone: (
StendhalRPZone) The zone this will be removed from.
- notifyWorldAboutChanges()
- Notifies the
StendhalRPWorldthat this entity's attributes have changed.
- describe()
- Describes then entity (commonly used for when a player "looks" at an entity).
- returns: (
string) Description from the player's point-of-view.
- slotIterator(slotTypes)
- slotTypes: (
Slots) Slot types to include in the iteration. - returns: (
Iterator<RPSlot>)
- slots(slotTypes)
- slotTypes: (
Slots) Slot types to include in the iteration. - returns: (
Iterable<RPSlot>)
Public static methods:
- generateRPClass()
- Initializes the RPClass for this entity (initialized from games.stendhal.server.core.engine.RPClassGenerator).
ActiveEntity
- Class: games.stendhal.server.entity.ActiveEntity
- Inherits: Entity
Public methods:
- ActiveEntity()
- Default constructor.
- ActiveEntity(object)
- Copy constructor.
- object: (
RPObject) Object to be copied.
- setSpeed(speed)
- Sets the entity's current movement speed.
- speed: (
double)
- setDirection(dir)
- Sets the entity's facing direction.
- dir: (
Direction) Direction to face.
- setIgnoresCollision(ignore)
- Sets whether or not the entity should be able to traverse collision tiles.
- ignore: (
boolean) Iftruesets the "ignore_collision" attribute, otherwise removes it.
- applyMovement()
- getDirection()
- Retrieves the entities current facing direction.
- returns: (
Direction)
- getSpeed()
- Retrieves the speed at which the entity is currently moving.
- returns: (
double)
- getStepsTaken()
- Retrieves the number of steps the entity has taken during the current session.
- returns: (
int)
- getDirectionToward(entity)
- Retrieves the direction from this entity to another.
- entity: (
Entity) Entity from which to gauge direction. - returns: (
Direction)
- getDirectionToward(area)
- area: (
Rectangle2D) - returns: (
Direction)
- isGhost()
- Checks whether an entity is a ghost (not physically interactive).
- returns: (
boolean)trueif "ghostmode" attribute is set (players only).
- stop()
- Stops the entity's movement.
- isFacingToward(entity)
- Determines if this entity is facing toward another entity.
- entity: (
Entity) Target entity. - returns: (
boolean)trueif facing other entity.
- faceto(x, y)
- Face toward a specific point on the map.
- x: (
int) Horizontal position of point to face. - y: (
int) Vertical position of point to face.
- faceToward(entity)
- Face toward a specific entity.
- entity: (
Entity) Entity to face toward.
- canMoveTo(x, y)
- Predicts if entity can move to a position.
- x: (
int) Horizontal position of the target point. - y: (
int) Vertical position of the target point. - returns: (
boolean)trueif nothing is preventing entity from moving to target point.
- canMoveTo(pos)
- Predicts if entity can move to a position.
- pos: (
Point) Target point. - returns: (
boolean)trueif nothing is preventing entity from moving to target point.
- ignoresCollision()
- Checks if the entity can pass through collision tiles.
- returns: (
boolean)trueif the "ignore_collision" attribute is set.
Public static methods:
- generateRPClass()
- Initializes the RPClass for this entity (initialized from games.stendhal.server.core.engine.RPClassGenerator).
GuidedEntity
- Class: games.stendhal.server.entity.GuidedEntity
- Inherits: ActiveEntity
Public methods:
- GuidedEntity ()
- Default constructor.
- GuidedEntity (object)
- object : (
RPObject) Object to be copied.
- setBaseSpeed (bs)
- Set entity's normal movement speed.
- bs : (
double) New normal speed for moving.
- setPath (path, position)
- Set a path for this entity to follow.
- path : (
FixedPath) Path to follow. - position : (
int) (optional) The position of the path where the entity should start (this is not the same assetPosition()).
- setPathAndPosition (path)
- Set path & starting position for entity.
- path : (
FixedPath) Path to follow.
- setPathPosition (pathPos)
- Sets the entity's position in its path.
- pathPos : (
int) Position to set.
- retracePath ()
- Causes entity to retrace its path backwards when it reaches the end.
- setCollisionAction (action)
- Set action type to take when entity collides.
- action : (
CollisionAction) Behavior type after collision.
- getBaseSpeed ()
- Retreives entity's normal movement speed.
- returns: (
double)
- getPath ()
- Retrieves the entity's current path.
- returns: (
FixedPath)
- getPathPosition ()
- Retrieves the entity's current position in its path.
- returns: (
int)
- getGuide ()
- returns: (
EntityGuide)
- getCollisionAction ()
- returns: (
CollisionAction)
- hasPath ()
- Checks if the entity has a path set.
- returns: (
boolean)
- isPathLoop ()
- Checks if the entity's path loops.
- returns: (
boolean)
- clearPath ()
- Removes the entity's path.
- reroute ()
- Plan a new path to destination.
- followPath ()
- returns: (
boolean)
- addSuspend (duration, dir, pos...)
- Add a suspension to the entity's path.
- duration : (
in) - dir : (
Direction) (optional) - pos... : (
int[]) - NOTE: this method is experimental.
- removeSuspend (pos...)
- Removes a suspension from path.
- pos... : (
int[]) - NOTE: this method is experimental.
- onFinishedPath ()
- updateModifedAttributes ()
- atMovementRadius ()
- returns: (
boolean)
- onOutsideMovementRadius ()
- setRandomMovementRadius (radius, ret)
- radius : (
int) - ret : (
boolean) (optional)
RPEntity
- Class: games.stendhal.server.entity.RPEntity (abstract)
- Inherits: GuidedEntity
Public methods:
- RPEntity ()
- Default constructor.
- RPEntity (object)
- Copy constructor.
- object : (
RPObject) Object to be copied.
- setName (name)
- Sets the entity's name attribute.
- name : (
String) String to be used as name.
- setLevel (level)
- Sets the entity's level.
- level : (
int)
- addKarma (karma)
- Adds good or bad karma (players only).
- karma : (
double) Amount to be added (negative amount represents "bad" karma).
- getLevel ()
- Retrieves the entity's current level.
- returns: (
int)
- getKarma ()
- Retrieves current karma level.
- returns: (
double)
- useKarma (scale)
- TODO
- useKarma (negLimit, posLimit[, granularity])
- TODO
- heal ([amount[, tell]])
- TODO
- addMana (mana, tell)
- TODO
- damageDone (defender, attackingWeaponsValue, damageType)
- TODO
- setAtk (atk)
- TODO
- getAtk ()
- TODO
- getCappedAtk ()
- TODO
- setAtkXP (atk)
- TODO
- addAtkXP (xp)
- TODO
- getAtkXP ()
- TODO
- incAtkXP (def)
- TODO
- setDef ()
- TODO
- getDef ()
- TODO
- getCappedDef ()
- TODO
- setDefXP ()
- TODO
- addDefXP (xp)
- TODO
- getDefXP ()
- TODO
- incDefXP ()
- TODO
- setRatk (ratk)
- TODO
- getRatk ()
- TODO
- getCappedRatk ()
- TODO
- setRatkXP (xp)
- TODO
- addRatkXP (xp)
- TODO
- getRatkXP ()
- TODO
- incRatkXP ()
- TODO
- initHP (hp)
- TODO
- setBaseHP (newhp)
- TODO
- getBaseHP ()
- TODO
- setHP (hp)
- TODO
- getHP ()
- TODO
- getLVCap ()
- TODO
- getMana ()
- TODO
- getBaseMana ()
- TODO
- setMana (newMana)
- TODO
- setBaseMana (newBaseMana)
- TODO
- addBaseMana (newBaseMana)
- TODO
- setLVCap (newLVCap)
- TODO
- setXP (newxp)
- TODO
- subXP (newxp)
- TODO
- addXP (newxp)
- TODO
- getXP ()
- TODO
- isAttackable ()
- TODO
- setTarget (target)
- TODO
- stopAttack ()
- TODO
- getsFightXpFrom (enemy)
- TODO
- stopAttacking (attacker)
- TODO
- rememberAttacker (attacker)
- TODO
- setBlood (name)
- TODO
- getBloodClass ()
- TODO
- getDroppables ()
- TODO
- dropDroppableItem (droppable)
- TODO
- maybeDropDroppables (attacker)
- TODO
- onDamaged (attacker, damage)
- TODO
- damage (amount, attacker)
- TODO
- delayedDamage (amount, attackerName)
- TODO
- onDead (killer[, remove])
- TODO
- getCorpseName ()
- TODO
- getHarmlessCorpseName ()
- TODO
- getCorpseWidth ()
- TODO
- getCorpseHeight ()
- TODO
- isInvisibleToCreatures ()
- TODO
- isAttacked ()
- TODO
- getAttackSources ()
- TODO
- returns: (
List<Entity>)
- getAttackingRPEntities ()
- TODO
- returns: (
List<RPEntity>)
- isAttacking ()
- TODO
- returns: (
boolean)
- getAttackTarget ()
- TODO
- returns: (
RPEntity)
- equipToInventoryOnly (item)
- TODO
- returns: (
boolean)
- getSlotToEquip (item)
- TODO
- returns: (
RPSlot)
- equipOrPutOnGround (item)
- TODO
- returns: (
boolean)
- equip (slotName, item)
- TODO
- returns: (
boolean)
- isEquipped (condition, amount)
- TODO
- returns: (
boolean)
- drop (<name> | <item>)
- TODO
- returns: (
boolean)
- dropWithInfostring (name, infostring[, amount])
- TODO
- returns: (
boolean)
- isEquipped (name[, amount])
- TODO
- returns: (
boolean)
- isEquippedWithInfostring (name, infostring[, amount])
- TODO
- returns: (
boolean)
- getNumberOfEquipped (name)
- TODO
- returns: (
int)
- getTotalNumberOf (name)
- TODO
- returns: (
int)
- getFirstEquipped (name)
- TODO
- returns: (
Item)
- getAllEquipped (name)
- TODO
- returns: (
List<Item>)
- getAllEquippedWithInfostring (name, infostring)
- TODO
- returns: (
List<Item>)
- isEquippedItemClass (slot, clazz)
- TODO
- returns: (
boolean)
- isEquippedItemInSlot (slot, item)
- TODO
- returns: (
boolean)
- getEquippedItemClass (slot, clazz)
- TODO
- returns: (
Item)
- getWeapon ()
- TODO
- returns: (
Item)
- getWeapons ()
- TODO
- returns: (
List<Item>)
- getRangeWeapon ()
- TODO
- returns: (
Item)
- getAmmunition ()
- TODO
- returns: (
StackableItem)
- getMissileIfNotHoldingOtherWeapon ()
- TODO
- returns: (
StackableItem)
- hasShield ()
- TODO
- returns: (
boolean)
- getShield ()
- TODO
- returns: (
Item)
- hasArmor ()
- TODO
- getArmor ()
- TODO
- hasHelmet ()
- TODO
- getHelmet ()
- TODO
- hasLegs ()
- TODO
- getLegs ()
- TODO
- hasBoots ()
- TODO
- getBoots ()
- TODO
- hasCloak ()
- TODO
- getCloak ()
- TODO
- hasRing ()
- TODO
- getRing ()
- TODO
- sendPrivateText (text)
- TODO
- sendPrivateText (type, text)
- TODO
- getItemAtk ()
- TODO
- getItemRatk ()
- TODO
- getItemDef ()
- TODO
- getDefenseItems ()
- TODO
- updateItemAtkDef ()
- TODO
- canDoRangeAttack (target, maxrange)
- TODO
- hasLineOfSight (target)
- TODO
- getMaxRangeForArcher ()
- TODO
- setTitle (title)
- TODO
- logic ()
- TODO
- canHit (defender)
- TODO
- getAtkRate ()
- TODO
- attack ()
- TODO
- handleLifesteal (attacker, attackerWeapons, damage)
- TODO
- getCorpseDeserver ()
- TODO
- getLanguage ()
- TODO
- setDeathSound (sound)
- TODO
- getDeathSound ()
- TODO
- addStatusAttacker (statusAttacker)
- TODO
- getStatusList ()
- TODO
- hasStatus (statusType)
- TODO
- setShadowStyle (st)
- TODO
Static public methods:
- generateRPClass ()
- applyDistanceAttackModifiers (damage, squareDistance, maxrange)
- TODO
DressedEntity
- Class: games.stendhal.server.entity.DressedEntity (abstract)
- Inherits: RPEntity
Public Methods:
- DressedEntity ()
- Default constructor.
- returns: (
DressedEntity) New instance.
- DressedEntity (object)
- Copy constructor.
- object : (
RPObject) Object to be copied. - returns: (
DressedEntity) New instance.
- getOutfit ()
- TODO
- returns: (
Outfit or null)
- getOriginalOutfit ()
- TODO
- returns: (
Outfit or null)
- getOutfitColors ()
- TODO
- setOutfit (outfit[, temporary])
- TODO
- setOutfit (layers)
- TODO
- setOutfit (temporary, layers)
- TODO
- setOutfit (strcode[, temporary])
- TODO
- setOutfitWithDetail (outfit, temporary)
- TODO
- setOutfitColor (part, color)
- TODO
- setOutfitColors (parts)
- TODO
- isNaked ()
- TODO
- unsetOutfitColor (part)
- TODO
- restoreOriginalOutfit ()
- TODO
NPC
- Class: games.stendhal.server.entity.npc.NPC (abstract)
- Inherits: DressedEntity
Public Members:
- pauseTurnsRemaining
- Type:
int
Public Methods:
- NPC ()
- Default constructor
- returns: (
NPC) New instance.
- NPC (object)
- Copy constructor.
- object : (
RPObject) Object to be copied. - returns: (
NPC) New instance.
- checkPause ()
- TODO
- getIdea ()
- TODO
- getMovementRange ()
- TODO
- getPerceptionRange ()
- TODO
- getSounds ()
- TODO
- moveRandomly ()
- TODO
- say (text)
- TODO
- setIdea (idea)
- Sets the NPC's idea/thought.
- idea : (
String) The idea mnemonic, ornull.
- setMovement (destEntity, min, max, maxPathRadius)
- TODO
- setMovementRange (movementRange)
- TODO
- setPathCompletedPause (pause[, dir])
- TODO
- setPerceptionRange (perceptionRange)
- TODO
- setRandomPathFrom (x, y, distance)
- TODO
- setSounds (sounds)
- TODO
PassiveNPC
- Class: games.stendhal.server.entity.npc.PassiveNPC (abstract)
- Inherits: NPC
Public Methods:
- createPath ()
- Does nothing unless overridden by sub-class.
- reversePath ()
- Changes entity's path to walk in opposite direction.
- setTeleportsFlag (teleports)
- TODO
- teleports : (
boolean)
- isTeleporter ()
- returns: (
boolean) teleports
SpeakerNPC
- Class: games.stendhal.server.entity.npc.SpeakerNPC
- Inherits: PassiveNPC
Public Methods:
- SpeakerNPC (name)
- Constructor.
- name : (
String) Name of the new entity.
- add (state, trigger, condition, nextState, reply, action)
- TODO
- add (state, trigger, condition, nextState, reply, action, label)
- TODO
- add (state, triggerStrings, condition, nextState, reply, action,label)
- TODO
- add (state, triggerStrings, condition, nextState, reply, action)
- TODO
- add (state, triggerStrings, condition, secondary, nextState, reply, action)
- TODO
- add (states, trigger, condition, nextState, reply, action)
- TODO
- add (states, triggerStrings, condition, nextState, reply, action)
- TODO
- add (state, triggerStrings, nextState, reply, action)
- TODO
- add (state, triggerStrings, nextState, reply, action, label)
- TODO
- addEmotion (triggerStrings, npcAction)
- TODO
- addEmotion (trigger, npcAction)
- TODO
- addEmotionReply (playerAction, npcAction)
- TODO
- addGoodbye ()
- TODO
- addGoodbye (text)
- TODO
- addGreeting ()
- Add default greeting.
- addGreeting (text)
- Add greeting text.
- text : (
String) Message to be displayed.
- addGreeting (text, action)
- TODO
- addHelp (helpDescription)
- TODO
- addInitChatMessage (condition, action)
- condition : (
ChatCondition) - action : (
ChatAction)
- addJob (jobDescription)
- TODO
- addMatching (state, trigger, matcher, condition, nextState, reply, action)
- TODO
- addOffer (offerDescription)
- TODO
- addQuest (text)
- TODO
- addReply (trigger, text)
- TODO
- addReply (triggerStrings, text)
- TODO
- addReply (trigger, text, action)
- TODO
- addReply (triggerStrings, text, action)
- TODO
- addReplyOnEmotion (playerAction, reply)
- TODO
- addWaitMessage ()
- TODO
- addWaitMessage (text, action)
- Message when attending another player.
- text : (
String) Message to be shown. - action : (
ChatAction)
- del (label)
- Delete transitions that match label.
- label : (
String) - returns: (
boolean)
- endConversation ()
- Ends interaction with player & sets to not attending.
- getAlternativeImage ()
- TODO
- getAttending ()
- Retrieves the entity currently talking to the NPC, or null if not attending anyone.
- returns: (
RPEntity) Entity attended to.
- getEngine ()
- TODO
- getJob ()
- TODO
- returns: (
String)
- getReply (trigger)
- TODO
- getReply (trigger, state, expressionType)
- TODO
- getTransitions ()
- TODO
- inConversationRange ()
- Checks if an entity is within range to interact.
- returns: (
boolean)
- isAllowedToActAlone ()
- returns: (
boolean)
- isTalking ()
- returns: (
boolean)
- listenTo (player, text)
- TODO
- onRejectedAttackStart (attacker)
- TODO
- preLogic ()
- setAllowToActAlone (allow)
- Allow or disallow the NPC to act without players in its zone.
- allow : (
boolean)
- setAlternativeImage (alternativeImage)
- TODO
- setAttending (rpendity)
- Sets the entity to whom the NPC is currently listening.
- rpentity : (
RPEntity) The entity with whom the NPC should be interacting
- setCurrentState (state)
- TODO
- setIdleDirection (dir)
- Sets the direction the entity will face while not interacting with a player.
- dir : (
Direction) Direction to face.
- setPlayerChatTimeout (playerChatTimeout)
- Sets the time a conversation can be paused before it will be terminated by the NPC.
- playerChatTimeout : (
long) Time in seconds.
SilentNPC
- Class: games.stendhal.server.entity.npc.SilentNPC
- Inherits: PassiveNPC