Graal Pastebin
New PastePasted on November 13, 2011.
View the raw file
function onActionPurchase() { client.gold -= params[1]; player.addweapon(params[2]); } function onCreated() { setShape(1,this.width,this.height); } //#CLIENTSIDE function onMouseDown() { if (mousex in | this.x, this.x + width | && mousey in | this.y, this.y + height | ) { Shop_Window1.visible = true; } else { return; } } function SetItem(itemname, itemprice, itemdesc, realitem) { Shop_Text1.text = "Item:" SPC itemname; Shop_Text2.text = "Price:" SPC itemprice; Shop_MultiLine1.text = itemdesc; client.realitem = realitem; client.store1 = itemname; client.store2 = itemprice; } function Shop_Button1.onAction() { if (client.gold > client.store2 - 1) { if (findweapon(client.store1) != NULL) { triggerAction(this.x, this.y, "purchase", null, client.store2,client.realitem); } } } function Shop_Button2.onAction() { Shop_Window1.visible = false; client.store1 = NULL; client.store2 = NULL; client.realitem = NULL; }