BTW, i made a slot machine npc

seven posibilities to win, 1,1,1 ,2,2,2, ,3,3,3,...so on
the npc generates 3 random numbers.
This forum houses many years of development, tracing back to some of the earliest posts that exist on the board. Its current use is for the continued development of the server and game it has always served: The Mana World.
ElvenProgrammer wrote:Maci: don't be rude, we're here to help people
Code: Select all
// Define required variables
name <- "Potion";
type <- 0;
attack <- 0;
defenst <- 0;
luck <- 0;
vitality <- 0;
//
function use()
{
print("Item " + name + " was used\n");
setHealth(getHealth() + 10);
}
Code: Select all
class Potion < Item
def use(being)
being.health += 10 # Increases health for target being
destroy # Destroys this item
end
end
Code: Select all
<item id="16" name="Potion" value="200" ...>
<use target="self">
<effect type="heal" duration="0" amount="10"/>
</use>
</item>
<item id="55" name="Helm of the bear" ...>
<equip>
<effect type="armor" amount="2"/>
<effect type="strength" amount="10"/>
</equip>
</item>