====== Creatures Class ====== Class For Creatures Interface [[developer_center:developer_editor:script|Return To Previous Page]] ------ ===== Api List ===== ^ Class:apiName(Parameters) ^ Return ^ Description ^ | Creature:getAttr(objid: number,[[developer_center:developer_editor:script:creatures_event#creature_attributes|CreaturesAttr]]) | ErrorCode.OK, value: number | Get the creature's attribute setting | | Creature:setAttr(objid: number,[[developer_center:developer_editor:script:creatures_event#creature_attributes|CreaturesAttr]], val: number) | ErrorCode.OK | Set the creature's attribute | | Creature:isAdult(objid: number) | ErrorCode.OK | Determine whether the creature is an adult | | Creature:setOxygenNeed(objid: number, v: boolean) | ErrorCode.OK | Set whether the creature relies on oxygen | | Creature:getTamedOwnerID(objid: number) | ErrorCode.OK, uin: number | Get the ID of the creature's domestication master (0 means untamed) | | Creature:setPanic(objid: number, v: boolean) | ErrorCode.OK | Set whether the creature is panicking | | Creature:setAIActive(objid: number, v: boolean) | ErrorCode.OK | Set whether the creature's AI is active | | Creature:getActorID(objid: number) | ErrorCode.OK, actorid: number | Get the biological actorID | | Creature:getActorName(objid: number) | ErrorCode.OK, name: string | Get the name of the creature | | Creature:addModAttrib(objid: number, [[developer_center:developer_editor:script:creatures_event#mod_attr_type|MOD ATTR TYPE]], value: number) | ErrorCode.OK | Increase module attributes | | Creature:getModAttrib(objid: number, [[developer_center:developer_editor:script:creatures_event#mod_attr_type|MOD ATTR TYPE]]) | ErrorCode.OK, value: number | Get module attributes | | Creature:setTeam(objids: number, teamid: number) | ErrorCode.OK | Set the creature's team | | Creature:getTeam(objid: number) | ErrorCode.OK, teamid: number | Get the creature's team | | Creature:getMaxFood(objid: number) | ErrorCode.OK, value: number | Get the maximum hunger of the creature | | Creature:getFood(objid: number) | ErrorCode.OK, value: number | Get the hunger of the creature | | Creature:setFood(objid: number, val: number) | ErrorCode.OK | Set the hunger of the creature | | Creature:getHpRecover(objid: number) | ErrorCode.OK, value: number | Get HP recovery of the creature | | Creature:getMaxOxygen(objid: number) | ErrorCode.OK, value: number | Get the maximum oxygen value of the creature | | Creature:getWalkSpeed(objid: number) | ErrorCode.OK, value: number | Get the walking speed of the creature | | Creature:getSwimSpeed(objid: number) | ErrorCode.OK, value: number | Get the swimming speed of the creature (speed in water) | | Creature:getJumpPower(objid: number) | ErrorCode.OK, value: number | Get the jump force of the creature | | Creature:getMass(objid: number) | ErrorCode.OK, value: number | Get the weight of the creature | | Creature:getDodge(objid: number) | ErrorCode.OK, value: number | Get the dodge of the creature | | Creature:getPunchAttack(objid: number) | ErrorCode.OK, value: number | Get the melee attack of the creature | | Creature:getRangeAttack(objid: number) | ErrorCode.OK, value: number | Get the remote attack of the creature | | Creature:getPunchDefense(objid: number) | ErrorCode.OK, value: number | Get the short-range defense of the creature | | Creature:getRangeDefense(objid: number) | ErrorCode.OK, value: number | Get the long-range defense of the creature | | Creature:setMaxHp(objid: number, val: number) | ErrorCode.OK | Set the maximum health points of the creature | | Creature:setHP(objid: number, val: number) | ErrorCode.OK | Set the health points of the creature | | Creature:setHpRecover(objid: number, val: number) | ErrorCode.OK | Set the HP recovery rate of the creature | | Creature:setOxygen(objid: number, val: number) | ErrorCode.OK | Set the oxygen level of the creature | | Creature:setWalkSpeed(objid: number, val: number) | ErrorCode.OK | Set the walking speed of the creature | | Creature:setSwimSpeed(objid: number, val: number) | ErrorCode.OK | Set the swimming speed of the creature (speed in water) | | Creature:setJumpPower(objid: number, val: number) | ErrorCode.OK | Set the jump force of the creature | | Creature:setDodge(objid: number, val: number) | ErrorCode.OK | Set the dodge of the creature | | Creature:setPunchAttack(objid: number, val: number) | ErrorCode.OK | Set the melee attack of the creature | | Creature:setRangeAttack(objid: number, val: number) | ErrorCode.OK | Set the remote attack of the creature | | Creature:setPunchDefense(objid: number, val: number) | ErrorCode.OK | Set the short-range defense of the creature | | Creature:setRangeDefense(objid: number, val: number) | ErrorCode.OK | Set the long-range defense of the creature | | Creature:replaceActor(objid: number, actorid: number, hp: number) | ErrorCode.OK | Replace the creature with a new biological | | Creature:GetMonsterDefName(monsterid: number) | ErrorCode.OK, name: string | Get the name of the creature type | | Creature:GetMonsterDefDesc(monsterid: number) | ErrorCode.OK, desc: string | Get the description of the creature type | ===== Creature constant list ===== ==== Creature Attributes ==== ^ NAME ^ CODE ^ Description ^ | CREATUREATTR.MAX_HP | 1 | Maximum health | | CREATUREATTR.CUR_HP | 2 | Current health | | CREATUREATTR.HP_RECOVER| 3 | Life recovery | | CREATUREATTR.MAX_HUNGER| 5 | Max Hunger | | CREATUREATTR.CUR_HUNGER| 6 | Current hunger bar | | CREATUREATTR.MAX_OXYGEN| 7 | Oxygen max | | CREATUREATTR.CUR_OXYGEN| 8 | Current oxygen value | | CREATUREATTR.RECOVER_OXYGEN| 9 | Oxygen recovery rate | | CREATUREATTR.WALK_SPEED| 10 | Moving speed | | CREATUREATTR.RUN_SPEED | 11 | Running speed | | CREATUREATTR.SWIN_SPEED| 13 | Swimming speed | | CREATUREATTR.JUMP_POWER| 14 | Jumping power | | CREATURE ATTR. WEIGHT | 15 | Weight | | CREATUREATTR.DODGE | 16 | Dodge rate | | CREATUREATTR.ATK_MELEE | 17 | Melee attack | | CREATUREATTR.ATK_REMOTE| 18 | Remote attack | | CREATUREATTR.DEF_MELEE | 19 | Melee defense | | CREATUREATTR.DEF_REMOTE| 20 | Remote defense | | CREATUREATTR.DIMENSION | 21 | Model size | ==== Creatures Type Attributes ==== ^ NAME ^ CODE ^ Description ^ | CREATUREATTR.ENABLE_MOVE | 1 | It can move | | CREATUREATTR.ENABLE_ATTACK | 32 | Attackable | | CREATUREATTR.ENABLE_BEATTACKED| 64 | Can be attacked | | CREATUREATTR.ENABLE_BEKILLED | 128 | Can be killed | | CREATUREATTR.ENABLE_PICKUP | 256 | Items that can be picked up | | CREATUREATTR.ENABLE_DEATHDROPITEM | 512 | Death drop item | ==== Creatures Motion ==== ^ NAME ^ CODE ^ Description ^ | CREATUREMOTION.IDLE | 1 | Idle | | CREATUREMOTION.STANDBY | 2 | Standby | | CREATUREMOTION.STROLL | 3 | Hang out | | CREATUREMOTION.ATK_MELEE | 4 | Melee attack | | CREATUREMOTION.ATK_REMOTE | 5 | Remote attack | | CREATUREMOTION.FOLLOW | 6 | Follow | | CREATUREMOTION.SWIM | 7 | Swim | | CREATUREMOTION.RUN_AWAY | 8 | Run away | | CREATUREMOTION.SELF_BOMB | 9 | Blew up | | CREATUREMOTION.BEATTRACTED | 10 | Be attracted | | CREATUREMOTION.COPULATION | 11 | Mating | ==== MOD ATTR TYPE ==== | MODATTRIB_TYPE.MODATTR_MOVE_SPEED | 0 | Moving speed | | MODATTRIB_TYPE.MODATTR_SWIM_SPEED | 1 | Swimming speed | | MODATTRIB_TYPE.MODATTR_JUMP_SPEED | 2 | Jump speed | | MODATTRIB_TYPE.MODATTR_ATTACK_PUNCH | 3 | Percentage bonus when attack close range | | MODATTRIB_TYPE.MODATTR_ATTACK_RANGE | 4 | Percentage bonus when attacking long range | | MODATTRIB_TYPE.MODATTR_ATTACK_EXPLODE| 5 | Percentage bonus when explosion hits | | MODATTRIB_TYPE.MODATTR_ATTACK_FIRE | 6 | Percentage bonus when attacking with fire | | MODATTRIB_TYPE.MODATTR_ATTACK_POISON | 7 | Percentage bonus when poisoning others | | MODATTRIB_TYPE.MODATTR_ATTACK_WITHER | 8 | Percentage bonus when attacking wither | | MODATTRIB_TYPE.MODATTR_ATTACK_PLAYER | 9 | Percentage bonus when attacking players | | MODATTRIB_TYPE.MODATTR_ATTACK_UNDEAD | 10 | Percentage bonus when attacking undead | | MODATTRIB_TYPE.MODATTR_ATTACK_ANIMAL | 11 | Percentage bonus when attacking animals | | MODATTRIB_TYPE.MODATTR_DAMAGED_PUNCH | 12 | Percentage bonus when damaged by melee | | MODATTRIB_TYPE.MODATTR_DAMAGED_RANGE | 13 | Percentage bonus when damaged by ranged | | MODATTRIB_TYPE.MODATTR_DAMAGED_EXPLODE| 14 | Percentage bonus when damaged by explosion | | MODATTRIB_TYPE.MODATTR_DAMAGED_FIRE | 15 | Percentage bonus when damaged by fire | | MODATTRIB_TYPE.MODATTR_DAMAGED_POISON| 16 | Percentage bonus when damaged by poison | | MODATTRIB_TYPE.MODATTR_DAMAGED_WITHER| 17 | Percentage bonus when damaged by wither | | MODATTRIB_TYPE.MODATTR_DAMAGED_FALLING| 18 | Percentage bonus for fall damage | | MODATTRIB_TYPE.MODATTR_ARMOR_PUNCH | 19 | Close range armor | | MODATTRIB_TYPE.MODATTR_ARMOR_RANGE | 20 | Long range armor bonus | | MODATTRIB_TYPE.MODATTR_ARMOR_EXPLODE | 21 | Explosive armor bonus points | | MODATTRIB_TYPE.MODATTR_DAMAGE_ABSORB | 22 | Damage absorption | | MODATTRIB_TYPE.MODATTR_CRITICAL_HIT | 23 | Critical damage bonus | | MODATTRIB_TYPE.MODATTR_KNOCK | 24 | Increased knockback distance when attacking | | MODATTRIB_TYPE.MODATTR_KNOCK_RESIST | 25 | Reduced knockback distance | | MODATTRIB_TYPE.MODATTR_KNOCK_RESIST_PROB | 26 | Probability resistance to knockback | | MODATTRIB_TYPE.MODATTR_ACTOR_SCALE | 27 | Character size (0 - 1.0, only valid for players)| | MODATTRIB_TYPE.MAX_MOB_MODATTR | 28 | Maximum monster enchantment attribute | | MODATTRIB_TYPE.MODATTR_DIG_SPEED | 28 | Mining speed | | MODATTRIB_TYPE.MODATTR_LUCK_DIG | 29 | Digging luck (0.2 increases drop probability) | | MODATTRIB_TYPE.MODATTR_LUCK_KILLMOB | 30 | Monster drop luck | | MODATTRIB_TYPE.MODATTR_VIEW_BRIGHT | 31 | Field of View Brightness (0 - 1.0) | | MODATTRIB_TYPE.MODATTR_OXYGEN_SUPPLY | 32 | Oxygen supply values | | MODATTRIB_TYPE.MAX_PLAYER_MODATTR | 33 | --- | | MODATTRIB_TYPE.MAX_MOD_ATTRIB | 33 | --- |