Mano vc nao tene a scrip para faze q npc player Fale Hi/Bless/yes q ele arruma a 5 bless?
- Forums
- xTibia - Notícias e Suporte
- Soluções
- Archived
- {resolvido} Ajuda Bless
info
Group: Conde
Joined: 07/05/08
Posts: 612
Reputation: +12
Tibia Character: leviana luciferiana

ta arrumado.
price = 50000 --for all bless, count in gps
function onUse(cid, item, fromPosition, itemEx, toPosition)
if(not getPlayerBlessing(cid,1)) then
if(doPlayerRemoveMoney(cid,price) == TRUE) then
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
doPlayerSendTextMessage(cid,22,"you are blessed.")
else
doPlayerSendTextMessage(cid,22,"You need "..price.." gps to buy all bless.")
end
else
doPlayerSendTextMessage(cid,22,"You have been blessed by one of the five gods!")
end
return TRUE
end
obs: quer que faça tanbem um por npc?
Edited Agosto 31 by Marcryzius
mano isso e para NPC?
info
Group: Conde
Joined: 04/07/09
Posts: 507
Reputation: +6

Carlosl, tome cuidado com Double Post, é proibido! E aprenda a escrever, pelo amor de Deus, se você não consegue escrever UMA palavra corretamente, sai desse Fórum e vai ler um pouco, aproveite, e leia tutoriais, quem sabe assim você não precisa ficar pedindo as coisas tão na mão, por que eles já deram o script, e você não pode arrumar os mínimos detalhes. Leia tutoriais, aprenda a fazer seus scripts, e aprenda a escrever, acerte dois numa bolada só =]
info
Group: Marquês
Joined: 17/01/08
Posts: 1.5k
Reputation: +15
Tibia Character: Saint Claire

Carlos, cuidado com o double post cara..
É proibido e você pode ser alertado por isto.
-
Procure escrever melhor, não da para entender nada do que você diz!
Abraços
info
Group: Conde
Joined: 07/05/08
Posts: 612
Reputation: +12
Tibia Character: leviana luciferiana

mano isso e para NPC?
não.
isso e pra ser usado por items.
obs: pelo visto o cara fala espanhol.
@Arthurfavilla: Lol, eu nao moro brasil é por isso que é difícil escrever corretamente. Ah s vc nao pode ajuda nao posta plz
@Daniel: Sorry nao volto a faze isso :S
@Marcryzius: S mano eu falo espanhol e pow isso q é difícil explicar o que eu preciso
Aqui está o 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
-- Config
local premium = 'Você não tem {premium} {account}!'
local nohavemoney = 'Você não tem dinheiro!'
local havebless = 'Você ja tem {Bless}!'
local ty = 'Valeu =D'
local money = 50000
-- Config
player_gold = getPlayerItemCount(cid,2148)
player_plat = getPlayerItemCount(cid,2152)*100
player_crys = getPlayerItemCount(cid,2160)*10000
player_money = player_gold + player_plat + player_crys
if isPremium(cid) then
if msgcontains(msg, 'bless') or msgcontains(msg, 'all') then
selfSay('Você deseja {todas} as {Bless} por '..money..'gps?', cid)
talkState[talkUser] = 1
end
if msgcontains(msg, 'yes') and talkState[talkUser] == 1 then
if getPlayerBlessing(cid, 1) or getPlayerBlessing(cid, 2) or getPlayerBlessing(cid, 3) or getPlayerBlessing(cid, 4) or getPlayerBlessing(cid, 5) then
selfSay(havebless, cid)
else
if player_money >= money then
doPlayerRemoveMoney(cid, money)
doPlayerAddBlessing(cid, 1)
doPlayerAddBlessing(cid, 2)
doPlayerAddBlessing(cid, 3)
doPlayerAddBlessing(cid, 4)
doPlayerAddBlessing(cid, 5)
selfSay(ty, cid)
else
selfSay(nohavemoney, cid)
end
end
end
else
selfSay(premium, cid)
end
------------------------------------------------ confirm no ------------------------------------------------
if msgcontains(msg, 'no') then
selfSay('Ok than.', cid)
talkState[talkUser] = 0
end
return true
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Tiver algum bug reporta ai
Edited Setembro 1 by kkk11111




info
Group: Campones
Joined: 02/01/08
Posts: 13
Reputation: 0
muito bm mais agora mais aun s vc tene bless e vc fiza d novo ela pega na din e nao fala Vc ja tene Bless :S
mais bm brigado kkk11111 vc ajudo muito