C# Class Aura.Channel.Scripting.Scripts.ItemScript

Item script base
Stat updates are done automatically, after running the scripts.
Inheritance: GeneralScript
显示文件 Open project: aura-project/aura

Public Methods

Method Description
Init ( ) : bool

Called when script is initialized after loading it.

OnCreation ( Item item ) : void

Executed when item is first created.

OnEquip ( Creature creature, Item item ) : void

Executed when item is equipped.

OnUnequip ( Creature creature, Item item ) : void

Executed when item is unequipped.

OnUse ( Creature creature, Item item, string parameter ) : void

Executed when item is used.

Protected Methods

Method Description
ActivateChatSticker ( Creature creature, ChatSticker sticker, int duration ) : void

Activates the sticker for the given duration.

AddGesture ( Creature creature, string keyword, string name ) : void

Adds gesture by keyword.

Buff ( Creature creature, Item item, int timeout, double str, double int_, double dex, double will, double luck, double life, double mana, double stamina, double lifeRecovery, double manaRecovery, double staminaRecovery, double injuryRecovery, int defense, int protection ) : void

Activates food stat mods for the given timeout and stats.

Feed ( Creature creature, double hunger, double weight, double upper, double lower, double str, double int_, double dex, double will, double luck, double life, double mana, double stm ) : void

Reduces hunger by amount and handles weight gain/loss and stat bonuses.

Body and stat changes are applied inside Creature, on MabiTick (every 5 minutes).

Heal ( Creature creature, double life, double mana, double stamina, double toxicity ) : void

Heals a certain amount of life, mana, and stamina.

HealFull ( Creature creature, double toxicity ) : void

Heals life, mana, and stamina completely.

HealRate ( Creature creature, double life, double mana, double stamina, double toxicity ) : void

Heals a certain percentage of life, mana, and stamina.

MagicSeal ( Item item, string color, string script = null ) : void

Adds magic seal meta data to item.

ShootFirework ( Location location, FireworkType type, string message ) : void
SummonBrownie ( Creature creature, Item item, string typeName ) : void

Spawns brownie for creature's personal shop.

TrainSkill ( Creature creature, SkillId skillId, int condition ) : void

Trains the specified condition for skill by one.

Treat ( Creature creature, double injuries, double toxicity ) : void

Reduces injuries by amount.

Weaken ( Creature creature, int levels, int duration ) : void

Activates weaken conditions for creature.

Private Methods

Method Description
GetToxicityStage ( double toxicity ) : ToxicityStage

Returns toxicity stage based on given toxicity.

Poison ( Creature creature, double life, double mana, double stamina, double toxicity ) : void

Handles potion poisoning.

The stages and the toxicity in general are based on information from the Wiki and in-game obsvervation.

Method Details

ActivateChatSticker() protected method

Activates the sticker for the given duration.
protected ActivateChatSticker ( Creature creature, ChatSticker sticker, int duration ) : void
creature Aura.Channel.World.Entities.Creature
sticker ChatSticker Sticker to activate.
duration int Duration in seconds.
return void

AddGesture() protected method

Adds gesture by keyword.
protected AddGesture ( Creature creature, string keyword, string name ) : void
creature Aura.Channel.World.Entities.Creature
keyword string
name string
return void

Buff() protected method

Activates food stat mods for the given timeout and stats.
protected Buff ( Creature creature, Item item, int timeout, double str, double int_, double dex, double will, double luck, double life, double mana, double stamina, double lifeRecovery, double manaRecovery, double staminaRecovery, double injuryRecovery, int defense, int protection ) : void
creature Aura.Channel.World.Entities.Creature
item Item
timeout int
str double
int_ double
dex double
will double
luck double
life double
mana double
stamina double
lifeRecovery double
manaRecovery double
staminaRecovery double
injuryRecovery double
defense int
protection int
return void

Feed() protected method

Reduces hunger by amount and handles weight gain/loss and stat bonuses.
Body and stat changes are applied inside Creature, on MabiTick (every 5 minutes).
protected Feed ( Creature creature, double hunger, double weight, double upper, double lower, double str, double int_, double dex, double will, double luck, double life, double mana, double stm ) : void
creature Aura.Channel.World.Entities.Creature
hunger double
weight double
upper double
lower double
str double
int_ double
dex double
will double
luck double
life double
mana double
stm double
return void

Heal() protected method

Heals a certain amount of life, mana, and stamina.
protected Heal ( Creature creature, double life, double mana, double stamina, double toxicity ) : void
creature Aura.Channel.World.Entities.Creature
life double
mana double
stamina double
toxicity double
return void

HealFull() protected method

Heals life, mana, and stamina completely.
protected HealFull ( Creature creature, double toxicity ) : void
creature Aura.Channel.World.Entities.Creature
toxicity double
return void

HealRate() protected method

Heals a certain percentage of life, mana, and stamina.
protected HealRate ( Creature creature, double life, double mana, double stamina, double toxicity ) : void
creature Aura.Channel.World.Entities.Creature
life double
mana double
stamina double
toxicity double
return void

Init() public method

Called when script is initialized after loading it.
public Init ( ) : bool
return bool

MagicSeal() protected method

Adds magic seal meta data to item.
protected MagicSeal ( Item item, string color, string script = null ) : void
item Item
color string
script string
return void

OnCreation() public method

Executed when item is first created.
public OnCreation ( Item item ) : void
item Item
return void

OnEquip() public method

Executed when item is equipped.
public OnEquip ( Creature creature, Item item ) : void
creature Aura.Channel.World.Entities.Creature
item Item
return void

OnUnequip() public method

Executed when item is unequipped.
public OnUnequip ( Creature creature, Item item ) : void
creature Aura.Channel.World.Entities.Creature
item Item
return void

OnUse() public method

Executed when item is used.
public OnUse ( Creature creature, Item item, string parameter ) : void
creature Aura.Channel.World.Entities.Creature
item Item
parameter string
return void

ShootFirework() protected method

protected ShootFirework ( Location location, FireworkType type, string message ) : void
location Aura.Channel.World.Location
type FireworkType
message string
return void

SummonBrownie() protected method

Spawns brownie for creature's personal shop.
protected SummonBrownie ( Creature creature, Item item, string typeName ) : void
creature Aura.Channel.World.Entities.Creature
item Item
typeName string
return void

TrainSkill() protected method

Trains the specified condition for skill by one.
protected TrainSkill ( Creature creature, SkillId skillId, int condition ) : void
creature Aura.Channel.World.Entities.Creature
skillId SkillId
condition int
return void

Treat() protected method

Reduces injuries by amount.
protected Treat ( Creature creature, double injuries, double toxicity ) : void
creature Aura.Channel.World.Entities.Creature
injuries double
toxicity double
return void

Weaken() protected method

Activates weaken conditions for creature.
protected Weaken ( Creature creature, int levels, int duration ) : void
creature Aura.Channel.World.Entities.Creature
levels int Amount of levels to lower the power level.
duration int Duration of the state.
return void