yes, no seu caso o points é essa coluna `premium_points` ?
5
983
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

25 de julho de 2012 às 12:45
info
Grupo: Artesão
Registrado: 28/09/08
Posts: 110
Reputação: +38
Gênero: Masculino
Char no Tibia: ...

25 de julho de 2012 às 15:43
sim, essa mesmo, do site do gesior!
info
Grupo: Herói
Registrado: 20/05/10
Posts: 3.4k
Reputação: +1.5k
Gênero: Masculino

25 de julho de 2012 às 16:06
em lib/ 050-function adc
function getAccountPoints(cid)
local res = db.getResult('select `premium_points` from accounts where name = \''..getPlayerAccount(cid)..'\'')
if(res:getID() == -1) then
return false
end
local ret = res:getDataInt("premium_points")
res:free()
return tonumber(ret)
end
function doAccountAddPoints(cid, count)
return db.executeQuery("UPDATE `accounts` SET `premium_points` = '".. getAccountPoints(cid) + count .."' WHERE `name` ='"..getPlayerAccount(cid).."'")
end
npc:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)
local talkState = {}
function onCreatureAppear(cid) npcHandler:onCreatureAppear(cid) end
function onCreatureDisappear(cid) npcHandler:onCreatureDisappear(cid) end
function onCreatureSay(cid, type, msg) npcHandler:onCreatureSay(cid, type, msg) end
function onThink() npcHandler:onThink() end
function creatureSayCallback(cid, type, msg)
if(not npcHandler:isFocused(cid)) then
return false
end
local talkUser = NPCHANDLER_CONVbehavior == CONVERSATION_DEFAULT and 0 or cid
local msg = string.lower(msg)
local item,count = 6500,5000
local points = 1
if isInArray({"trocar","troca","exchange","change"}, msg) then
npcHandler:say("Você quer trocar "..count.." ".. getItemNameById(item) .." por "..points.." premium points? {yes}", cid)
talkState[talkUser] = 1
elseif isInArray({"yes","sim"}, msg) and talkState[talkUser] == 1 then
if doPlayerRemoveItem(cid, item, count) then
npcHandler:say("Obrigado, você recebeu "..points.." premium points!", cid)
doAccountAddPoints(cid, points)
else
npcHandler:say("Desculpe, você não tem os items!", cid)
end
elseif msg == "no" then
selfSay("Tudo bem então", cid)
talkState[talkUser] = 0
npcHandler:releaseFocus(cid)
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado Julho 25 por Vodkart


info
Grupo: Artesão
Registrado: 28/09/08
Posts: 110
Reputação: +38
Gênero: Masculino
Char no Tibia: ...
nome serv: crystal server
versão: 8.70
Galera, eu gostaria de um npc que ao trocar 5000 item (6500 Id do item [demonic essence]) o npc da 1 point no shop do website para o player...
Séria possivel essa ídeia genial? Agradeço!