Ir para conteúdo
  • Cadastre-se

PEDIDO Segunda promotion VIP e NPC [TFS 1.0]


Posts Recomendados

Fala galera, preciso de um npc que venda a segunda promotion, e esse npc só vai ter na area vip, ou seja só vip pode ter a segunda promotion, segue o código da promotion que eu criei se tiver algo errado por favor me corrijam.

<vocation id="9" clientid="3" name="Noble Master Sorcerer" description="a noble master sorcerer" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="20" gainmanaticks="1" gainmanaamount="50" manamultiplier="1.1" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="1">


        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="2.0"/>
        <skill id="1" multiplier="2.5"/>
        <skill id="2" multiplier="2.5"/>
        <skill id="3" multiplier="2.5"/>
        <skill id="4" multiplier="2.5"/>
        <skill id="5" multiplier="2.0"/>
        <skill id="6" multiplier="1.6"/>
    </vocation>
    <vocation id="10" clientid="4" name="Noble Elder Druid" description="an noble elder druid" gaincap="10" gainhp="5" gainmana="30" gainhpticks="2" gainhpamount="20" gainmanaticks="1" gainmanaamount="50" manamultiplier="1.1" attackspeed="1500" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="2">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="2.0"/>
        <skill id="1" multiplier="2.3"/>
        <skill id="2" multiplier="2.3"/>
        <skill id="3" multiplier="2.3"/>
        <skill id="4" multiplier="2.3"/>
        <skill id="5" multiplier="2.0"/>
        <skill id="6" multiplier="1.6"/>
    </vocation>
    <vocation id="11" clientid="2" name="Noble Royal Paladin" description="a noble royal paladin" gaincap="20" gainhp="10" gainmana="15" gainhpticks="2" gainhpamount="25" gainmanaticks="1" gainmanaamount="35" manamultiplier="1.4" attackspeed="1400" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="3">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.7"/>
        <skill id="1" multiplier="1.7"/>
        <skill id="2" multiplier="1.7"/>
        <skill id="3" multiplier="1.7"/>
        <skill id="4" multiplier="1.6"/>
        <skill id="5" multiplier="1.6"/>
        <skill id="6" multiplier="1.6"/>
    </vocation>
    <vocation id="12" clientid="1" name="Noble Elite Knight" description="an noble elite knight" gaincap="25" gainhp="15" gainmana="5" gainhpticks="1" gainhpamount="30" gainmanaticks="1" gainmanaamount="20" manamultiplier="3.0" attackspeed="1300" basespeed="220" soulmax="200" gainsoulticks="15" fromvoc="4">
        <formula meleeDamage="1.0" distDamage="1.0" defense="1.0" armor="1.0"/>
        <skill id="0" multiplier="1.6"/>
        <skill id="1" multiplier="1.6"/>
        <skill id="2" multiplier="1.6"/>
        <skill id="3" multiplier="1.6"/>
        <skill id="4" multiplier="1.9"/>
        <skill id="5" multiplier="1.6"/>
        <skill id="6" multiplier="1.6"/>
    </vocation>

 

Essa promotion upara os skills mais rapidamente, eu alterei nos skill id, não sei se ta certo, mas pela lógica eu axo que eh ali mesmo, enfim o sistema vip que eu uso usa a storage 9999 se ajudar, esse eh o meu vip system:
https://otland.net/threads/vip-system-the-forgotten-server-1-0.224910/#post-2163589

Gostaria de um npc que de a segunda promotion só se o player tiver vip, por dinheiro normal do jogo, e que quando acabasse a vip, voltasse a ser promotion 1 (master sorcerer, etc..) e que só consiga ter a promotion 2 se tiver a promotion 1, lembrando que eu uso TFS 1.0, obrigado desde já!
 

Editado por Andreselos1988 (veja o histórico de edições)

1545517_5.png

Link para o post
Compartilhar em outros sites
  • Respostas 42
  • Created
  • Última resposta

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

local money = xxxx -- Quanto vai custar local storage = 14542 -- Não mexer local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcH

local money = xxxx -- Quanto vai custar local storage = 14542 -- Não mexer local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parseParameters(npcH

Tenta isso: local money = xxxx -- Quanto vai custar local storage = 14542 -- Não mexer local keywordHandler = KeywordHandler:new() local npcHandler = NpcHandler:new(keywordHandler) NpcSystem.parse

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower, 'yes') and npcHandler.topic[cid] == 1 then
		if isInArray({5, 6, 7, 8}, player:getVocation()) then	
			if player:getVipDays() >= 1 then
	        	if player:removeMoney(money) then
	        		npcHandler:say('you just received a new promotion', cid)
	        		player:setVocation(player:getVocation() + 4)
	        		player:setStorageValue(storage, 1)
	        		npcHandler.topic[cid] = 0
	        	else
	        		npcHandler:say('you no have money', cid)
	        		npcHandler.topic[cid] = 0
	        	end
	        else
	        	npcHandler:say('You do not have any vip days.', cid)
	        	npcHandler.topic[cid] = 0
	        end
	    else
	    	npcHandler:say('you no have first promotion', cid)
	    	npcHandler.topic[cid] = 0
	    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

em creaturescripts :

 

function onLogin(cid)

	local storage = 14542;
	player = Player(cid);

	if player:getVipDays() == 0 and player:getStorageValue(storage) == 1 then
		player:setVocation(player:getVocation() - 4)
		player:setStorageValue(storage, - 1)
	end
	
	return true
end
Editado por Summ (veja o histórico de edições)

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites
local money = xxxx, -- Quanto vai custar
local storage = 14542, -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)]
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower, 'yes') and npcHandler.topic[cid] == 1 then
		if isInArray({5, 6, 7, 8}, player:getVocation()) then	
			if player:getVipDays() >= 1 then
	        	if player:removeMoney(money) then
	        		npcHandler:say('you just received a new promotion', cid)
	        		player:setVocation(player:getVocation() + 4)
	        		player:setStorageValue(storage, 1)
	        		npcHandler.topic[cid] = 0
	        	else
	        		npcHandler:say('you no have money', cid)
	        		npcHandler.topic[cid] = 0
	        	end
	        else
	        	npcHandler:say('You do not have any vip days.', cid)
	        	npcHandler.topic[cid] = 0
	        end
	    else
	    	npcHandler:say('you no have first promotion', cid)
	    	npcHandler.topic[cid] = 0
	    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

em creaturescripts :

 

function onLogin(cid)

	local storage = 14542;
	player = Player(cid);

	if player:getVipDays() == 0 and player:getStorageValue(storage) == 1 then
		player:setVocation(player:getVocation() - 4)
		player:setStorageValue(storage, - 1)
	end
	
	return true
end

Obrigado vou testar, aonde ta local storage = 14542, -- Não mexer

pode colocar 9999?

1545517_5.png

Link para o post
Compartilhar em outros sites

Cara deixa a storage que tá ... se trocar vai dar problema e pra que tu quer mudar pra essa storage "9999"?

Okay nao mudei nada, porem ta dando esse erro na distro

[Warning - NpcScript::NpcScript] Can not load script: Queen Alice.lua

data/npc/scripts/Queen Alice.lua:2: unexpected symbol near 'local'

ps: eu queria trocar pra 9999 pq é a storage da vip, e eu pensei que essa linha tinha algo a ver..

Editado por Andreselos1988 (veja o histórico de edições)

1545517_5.png

Link para o post
Compartilhar em outros sites

Tente agora editei la em cima... eu tinha colocado uma "," no final rsrsr

hahaha okay, agora deu esse erro..

[Warning - NpcScript::NpcScript] Can not load script: Queen Alice.lua

data/npc/scripts/Queen Alice.lua:26: unexpected symbol near ']'

 

1545517_5.png

Link para o post
Compartilhar em outros sites

editei dnv KAOSKAPOSK, isso que dá fazer script na madrugada...

UAHSUHASUHAS pega nada cara, o que importa eh vc estar me ajudando, e segue ae mais um erro SAUHUHSAUHAS

[Warning - NpcScript::NpcScript] Can not load script: Queen Alice.lua

data/npc/scripts/Queen Alice.lua:30: function arguments expected near ','

 

1545517_5.png

Link para o post
Compartilhar em outros sites
local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
		if isInArray({5, 6, 7, 8}, player:getVocation()) then	
			if player:getVipDays() >= 1 then
	        	if player:removeMoney(money) then
	        		npcHandler:say('you just received a new promotion', cid)
	        		player:setVocation(player:getVocation() + 4)
	        		player:setStorageValue(storage, 1)
	        		npcHandler.topic[cid] = 0
	        	else
	        		npcHandler:say('you no have money', cid)
	        		npcHandler.topic[cid] = 0
	        	end
	        else
	        	npcHandler:say('You do not have any vip days.', cid)
	        	npcHandler.topic[cid] = 0
	        end
	    else
	    	npcHandler:say('you no have first promotion', cid)
	    	npcHandler.topic[cid] = 0
	    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites
local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
		if isInArray({5, 6, 7, 8}, player:getVocation()) then	
			if player:getVipDays() >= 1 then
	        	if player:removeMoney(money) then
	        		npcHandler:say('you just received a new promotion', cid)
	        		player:setVocation(player:getVocation() + 4)
	        		player:setStorageValue(storage, 1)
	        		npcHandler.topic[cid] = 0
	        	else
	        		npcHandler:say('you no have money', cid)
	        		npcHandler.topic[cid] = 0
	        	end
	        else
	        	npcHandler:say('You do not have any vip days.', cid)
	        	npcHandler.topic[cid] = 0
	        end
	    else
	    	npcHandler:say('you no have first promotion', cid)
	    	npcHandler.topic[cid] = 0
	    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Aeee esse nao deu erro \o vou testar, e ja aviso aqui se deu certo!

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
		if isInArray({5, 6, 7, 8}, player:getVocation()) then	
			if player:getVipDays() >= 1 then
	        	if player:removeMoney(money) then
	        		npcHandler:say('you just received a new promotion', cid)
	        		player:setVocation(player:getVocation() + 4)
	        		player:setStorageValue(storage, 1)
	        		npcHandler.topic[cid] = 0
	        	else
	        		npcHandler:say('you no have money', cid)
	        		npcHandler.topic[cid] = 0
	        	end
	        else
	        	npcHandler:say('You do not have any vip days.', cid)
	        	npcHandler.topic[cid] = 0
	        end
	    else
	    	npcHandler:say('you no have first promotion', cid)
	    	npcHandler.topic[cid] = 0
	    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

Cara funcionou numa boa o npc, mas quando vou colocar a segunda promotion ela responde assim

13:42 Queen Alice: you no have first promotion

ps: já ta com a primeira promotion

Editado por Andreselos1988 (veja o histórico de edições)

1545517_5.png

Link para o post
Compartilhar em outros sites

Tente :

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
		for x = 5, 8 do	
			if player:getVocation() == x then
				break
				if player:getVipDays() >= 1 then
		        	if player:removeMoney(money) then
		        		npcHandler:say('you just received a new promotion', cid)
		        		player:setVocation(player:getVocation() + 4)
		        		player:setStorageValue(storage, 1)
		        		npcHandler.topic[cid] = 0
		        	else
		        		npcHandler:say('you no have money', cid)
		        		npcHandler.topic[cid] = 0
		        	end
		        else
		        	npcHandler:say('You do not have any vip days.', cid)
		        	npcHandler.topic[cid] = 0
		        end
		    else
		    	npcHandler:say('you no have first promotion', cid)
		    	npcHandler.topic[cid] = 0
		    end
		end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

#editado

Editado por Summ (veja o histórico de edições)

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites

Tente :

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
		for x = 5, 8 do	
			if player:getVocation() == x then
				break
				if player:getVipDays() >= 1 then
		        	if player:removeMoney(money) then
		        		npcHandler:say('you just received a new promotion', cid)
		        		player:setVocation(player:getVocation() + 4)
		        		player:setStorageValue(storage, 1)
		        		npcHandler.topic[cid] = 0
		        	else
		        		npcHandler:say('you no have money', cid)
		        		npcHandler.topic[cid] = 0
		        	end
		        else
		        	npcHandler:say('You do not have any vip days.', cid)
		        	npcHandler.topic[cid] = 0
		        end
		    else
		    	npcHandler:say('you no have first promotion', cid)
		    	npcHandler.topic[cid] = 0
		    end
		end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

#editado

deu a mesma coisa

13:42 Queen Alice: you no have first promotion

ps: já ta com a primeira promotion

1545517_5.png

Link para o post
Compartilhar em outros sites

:hum:

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
                print(player:getVocation)
		for x = 5, 8 do	
			if player:getVocation() == x then
				if player:getVipDays() >= 1 then
		        	if player:removeMoney(money) then
		        		npcHandler:say('you just received a new promotion', cid)
		        		player:setVocation(player:getVocation() + 4)
		        		player:setStorageValue(storage, 1)
		        		npcHandler.topic[cid] = 0
		        		break
		        	else
		        		npcHandler:say('you no have money', cid)
		        		npcHandler.topic[cid] = 0
		        	end
		        else
		        	npcHandler:say('You do not have any vip days.', cid)
		        	npcHandler.topic[cid] = 0
		        end
		    else
		    	npcHandler:say('you no have first promotion', cid)
		    	npcHandler.topic[cid] = 0
		    end
		end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

eu coloquei pra printar algo no console da uma olhada pra mim que numero aparece...

Editado por Summ (veja o histórico de edições)

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites

:hum:

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
                print(player:getVocation)
		for x = 5, 8 do	
			if player:getVocation() == x then
				if player:getVipDays() >= 1 then
		        	if player:removeMoney(money) then
		        		npcHandler:say('you just received a new promotion', cid)
		        		player:setVocation(player:getVocation() + 4)
		        		player:setStorageValue(storage, 1)
		        		npcHandler.topic[cid] = 0
		        		break
		        	else
		        		npcHandler:say('you no have money', cid)
		        		npcHandler.topic[cid] = 0
		        	end
		        else
		        	npcHandler:say('You do not have any vip days.', cid)
		        	npcHandler.topic[cid] = 0
		        end
		    else
		    	npcHandler:say('you no have first promotion', cid)
		    	npcHandler.topic[cid] = 0
		    end
		end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	NpcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

eu coloquei pra printar algo no console da uma olhada pra mim que numero aparece...

No console que vc fala eh no distro? se for nao aparece nada, e continua a mesma coisa >.<

 

1545517_5.png

Link para o post
Compartilhar em outros sites

Olhe agora pra ver que numero aparece no console ao falar yes... sim distro é console...

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
        print(player:getVocation())
			if player:getVocation() == 5 or player:getVocation() == 6 or player:getVocation() == 7 or player:getVocation() == 8 then
				if player:getVipDays() >= 1 then
		        	if player:removeMoney(money) then
		        		npcHandler:say('you just received a new promotion', cid)
		        		player:setVocation(player:getVocation() + 4)
		        		player:setStorageValue(storage, 1)
		        		npcHandler.topic[cid] = 0
		        	else
		        		npcHandler:say('you no have money', cid)
		        		npcHandler.topic[cid] = 0
		        	end
		        else
		        	npcHandler:say('You do not have any vip days.', cid)
		        	npcHandler.topic[cid] = 0
		        end
		    else
		    	npcHandler:say('you no have first promotion', cid)
		    	npcHandler.topic[cid] = 0
		    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	npcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado por Summ (veja o histórico de edições)

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites

 

Olhe agora pra ver que numero aparece no console ao falar yes... sim distro é console...

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
        print(player:getVocation())
			if player:getVocation() == 5 or player:getVocation() == 6 or player:getVocation() == 7 or player:getVocation() == 8 then
				if player:getVipDays() >= 1 then
		        	if player:removeMoney(money) then
		        		npcHandler:say('you just received a new promotion', cid)
		        		player:setVocation(player:getVocation() + 4)
		        		player:setStorageValue(storage, 1)
		        		npcHandler.topic[cid] = 0
		        	else
		        		npcHandler:say('you no have money', cid)
		        		npcHandler.topic[cid] = 0
		        	end
		        else
		        	npcHandler:say('You do not have any vip days.', cid)
		        	npcHandler.topic[cid] = 0
		        end
		    else
		    	npcHandler:say('you no have first promotion', cid)
		    	npcHandler.topic[cid] = 0
		    end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	npcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

agora apareceu isto quando estava dando loading no server:

[Warning - NpcScript::NpcScript] Can not load script: Queen Alice.lua

data/npc/scripts/Queen Alice.lua:52: 'end' expected (to close 'function' at line 13) near 'elseif'

 

1545517_5.png

Link para o post
Compartilhar em outros sites

Eu já retirei esse end ... quando eu enviei, vi ele dps editei, quando eu postar olhe se eu não editei o tópico novamente pra corrigir/mudar algo.

Tenta dnv com o code acima.

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites

Eu já retirei esse end ... quando eu enviei, vi ele dps editei, quando eu postar olhe se eu não editei o tópico novamente pra corrigir/mudar algo.

Tenta dnv com o code acima.

hehehe não tinha visto, apareceu esse código no distro quando fala "yes"

userdata: 0x7f02c8068b58

Conseguiu amigo? Estou no aguardo :D

Editado por Andreselos1988 (veja o histórico de edições)

1545517_5.png

Link para o post
Compartilhar em outros sites

Não testei:

local money = xxxx -- Quanto vai custar
local storage = 14542 -- Não mexer

local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

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

local function creatureSayCallback(cid, type, msg)
	if not npcHandler:isFocused(cid) then
		return false
	end

	local player = Player(cid)

	if player:getStorageValue(storage) == 1 then
		npcHandler:say('you have already received the promotion', cid)
		return true
	end

	if msgcontains(msg:lower(), 'promotion') then
		npcHandler:say('you are sure?', cid)
		npcHandler.topic[cid] = 1
	end

	if msgcontains(msg:lower(), 'yes') and npcHandler.topic[cid] == 1 then
		if player:getPromotion() == 1 then
		    if player:getVipDays() >= 1 then
		       	if player:removeMoney(money) then
		       		npcHandler:say('you just received a new promotion', cid)
		       		player:setVocation(player:getVocation() + 4)
		       		player:setStorageValue(storage, 1)
		       		npcHandler.topic[cid] = 0
		       	else
		       		npcHandler:say('you no have money', cid)
		       		npcHandler.topic[cid] = 0
		       	end
		    else
		       	npcHandler:say('You do not have any vip days.', cid)
		       	npcHandler.topic[cid] = 0
		    end
		else
		   	npcHandler:say('you no have first promotion', cid)
		   	npcHandler.topic[cid] = 0
		end
    elseif msgcontains(msg:lower(), 'no') and npcHandler.topic[cid] == 1 then
    	npcHandler:say('Bye!!', cid)
    	npcHandler.topic[cid] = 0
    end

	return true
end

npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
Editado por Summ (veja o histórico de edições)

EQD4Qy4.gif

Link para o post
Compartilhar em outros sites

Participe da conversa

Você pode postar agora e se cadastrar mais tarde. Se você tem uma conta, faça o login para postar com sua conta.

Visitante
Responder

×   Você colou conteúdo com formatação.   Remover formatação

  Apenas 75 emojis são permitidos.

×   Seu link foi automaticamente incorporado.   Mostrar como link

×   Seu conteúdo anterior foi restaurado.   Limpar o editor

×   Não é possível colar imagens diretamente. Carregar ou inserir imagens do URL.

  • Quem Está Navegando   0 membros estão online

    Nenhum usuário registrado visualizando esta página.


  • Conteúdo Similar

    • Por LasseXeterno
      Então, estou tentando adicionar uma nova "race" no meu Ot de base Cyan, tentei seguir 3 tutoriais aqui do tibiaking, um sobre race, porém nos códigos do meu servidor não tem o constant.h e nem o monster.cpp. E o outro tutorial, eu fiz tudo que ele pediu e quando entrei no game para testar, funcionava os golpes e as imunidades, porém não aparecia o número do dano e nem a cor.  Usei esse tutorial como base: 
      Pois ele é derivado. E o outro tutorial que usei foi: 
      Porém nesse, não consegui achar a const.h, e quando fui nos arquivos do creaturescript e adicionei uma cor nova a "COLOR_FAIRY", quando abro o jogo, os pokemons que seriam teoricamente "fada", o que eu usei de teste foi a Clefable. A Clefable tomava IK e dava IK no seu atk do tipo fada. 
      Além de que, o meu erro principal é esse: Warning - Monsters::loadMonster] Unknown race type fairy. (data/monster/pokes/geracao 1/Clefable.xml)
       Pois como eu já disse, não consigo achar onde adicionar uma nova race.

    • Por yuriowns
      Salve rapazes, tranquilo? Preciso de ajuda pra colocar para os npc's que vendem pots verificarem quantos itens possuem no tile em que o player está e se tiver com +80 itens no sqm, o npc avisa e não vende nada até o player ir em um sqm com menos de 80 itens no chão.
       
    • Por A.Mokk
      .Qual servidor ou website você utiliza como base? 
      TFS 0.4
      Qual o motivo deste tópico? 
      Bom pessoal, a algumas semanas atras eu joguei um servidor que havia sistema de imbuimento sendo 8.60, no servidor se utilizava a spellwand para encantar as armas, os comandos eram dado no canal Imbuiment... Gostaria de saber se alguém teria como disponibilizar algum sistema de imbuimento, já procurei pra caramba aqui no fórum mas tudo que encontro é pra versões acima da que eu uso.
       
    • Por Mateus Robeerto
      Não sei se aqui é a área ou algum local para solicitar a alteração do email antigo... Não lembro mais a senha dele, nem a resposta secreta para acessar. Peço a algum administrador ou moderador para, por favor, alterar o email para o novo.

×
×
  • Criar Novo...

Informação Importante

Confirmação de Termo