// Wolf Roleplay example - FARM + PETS SETUP (run once by the game's owner on a region running // their game). Defines the items the farm and the pet shop use, and the wolf pup pet type. // Everything here can also be done from the control panel's Roleplay section. say(string what, integer ok) { if (ok) llOwnerSay(what + ": OK"); else llOwnerSay(what + ": REFUSED - " + wolfGetLastError()); } default { touch_start(integer n) { if (llDetectedKey(0) != llGetOwner()) return; if (wolfGameKey() == "") { llOwnerSay("This region runs no game - wolfGameCreate first."); return; } // Items: what players hold, on the grid, the same on every region of the game. say("item seed", wolfGameDefineItem("seed", ["label", "Wheat seed", "max", 500, "order", 1])); say("item wheat", wolfGameDefineItem("wheat", ["label", "Wheat", "max", 9999, "order", 2])); say("item pet_food", wolfGameDefineItem("pet_food", ["label", "Pet food", "max", 200, "order", 3])); // A pet type and its stats. Rates are per MINUTE and keep running while the pet is in // inventory or its owner is offline - a pup left a week without food will be gone. say("pet wolf_pup", wolfGameDefinePet("wolf_pup", ["label", "Wolf pup", "max", 3])); say("pup hunger", wolfGameDefinePetStat("wolf_pup", "hunger", ["label", "Food", "max", 100, "start", 80, "rate", -1, "zero", "die", "colour", "#84cc16", "order", 0])); say("pup happiness", wolfGameDefinePetStat("wolf_pup", "happiness", ["label", "Happy", "max", 100, "start", 80, "rate", -2, "zero", "none", "colour", "#eab308", "order", 1])); } }