Graal Pastebin

New Paste
Pasted 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;
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40