Ir para conteúdo
  • Cadastre-se

Posts Recomendados

Bom galera, esse comando ja foi utilizado no começo do Global War.

O que ele faz?

Em qualquer lugar do OT se o player dizer por exemplo:

!get smp

Ele vai comprar 50 strong mana potions.

Talkactions.xml


<talkaction words="!get" event="script" value="shop.lua"/>


local shop = {

["sh"] = {id = 8704, cost = 1000, charges = 50},

["small health"] = {id = 8704, cost = 1000, charges = 50},

["hp"] = {id = 7618, cost = 2250, charges = 50},

["health potion"] = {id = 7618, cost = 2250, charges = 50},

["mp"] = {id = 7620, cost = 2500, charges = 50},

["mana potion"] = {id = 7620, cost = 2500, charges = 50},

["shp"] = {id = 7588, cost = 5000, charges = 50},

["strong health potion"] = {id = 7588, cost = 5000, charges = 50},

["smp"] = {id = 7589, cost = 4000, charges = 50},

["strong mana potion"] = {id = 7589, cost = 4000, charges = 50},

["ghp"] = {id = 7591, cost = 9500, charges = 50},

["great health potion"] = {id = 7591, cost = 9500, charges = 50},

["gmp"] = {id = 7590, cost = 6000, charges = 50},

["great mana potion"] = {id = 7590, cost = 6000, charges = 50},

["gsp"] = {id = 8472, cost = 9500, charges = 50},

["great spirit potion"] = {id = 8472, cost = 9500, charges = 50},

["uhp"] = {id = 8473, cost = 15500, charges = 50},

["ultimate health potion"] = {id = 8473, cost = 15500, charges = 50}

}

function onSay(cid, words, param, channel)

if(param == "") then

  doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Command param required.")

  return true

end


local v = shop[param]

if (not v) then

  doPlayerSendCancel(cid,"Item not found.")

  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

  return true

    end


    if getTilePzInfo(getPlayerPosition(cid)) then

	 else

	    doPlayerSendCancel(cid, "Get rid of your PZ first.")

  doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)

	    return true

    end


if getPlayerVipDays(cid) < 1 then

	 doPlayerSendCancel(cid, "You need to be vip.")

	    return true

    end


local itemm = getItemWeightById(v.id, v.charges)

if getPlayerFreeCap(cid) < itemm then

	    doPlayerSendCancel(cid, "Sorry, you do not have enough cap. You need "..itemm.." oz to carry "..param..".")

  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

    end


if (getPlayerMoney(cid) < v.cost) then

	    doPlayerSendCancel(cid, "Sorry, you need "..v.cost.." gp to buy this item.")

  doSendMagicEffect(getPlayerPosition(cid), CONST_ME_POFF)

    else

	    doPlayerAddItem(cid,v.id,v.charges)

	    doPlayerRemoveMoney(cid, v.cost)

	    doSendMagicEffect(getThingPos(cid), CONST_ME_GIFT_WRAPS)

	    doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "Thanks for buying!")

  end

  return true											 

end

Créditos: DataPack GlobalWar

Link para o post
Compartilhar em outros sites
Visitante
Este tópico está impedido de receber novos posts.
  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo