Ir para conteúdo

Featured Replies

Postado

galera estou com um problema no meu script de reset do servidor 7.92 mapa dragon souls,

quando vou até o npc e falo Hi - Reset - Yes

o character tem as skills e ml resetados

mais não volta para o level 8.

 

vou explicar melhor,

quando você pega level 500 a primeira vez no servidor de estilo [dragon souls] e vai até o npc para resetar, nesse primeiro reset o script te dá uma nova vocação  te deixa level 8 e da uma quantidade de skills, e magic level

dai no caso no segundo reset em diante ele te deixa level 8 novamente ganha alguns skills e magic level, sem alterar vocação 

no caso apartir do segundo reset a vocação já não muda

 

o Script que uso,  vou deixar abaixo em seguida vou deixar a foto do erro que está acontecendo na distro

no caso igual comentei, os skills e ml o char esta recebendo, só não está mudando de vocação no primeiro reset e nem voltando para o level 8

 

 

Spoiler

local focus = 0
local talk_start = 0
local target = 0
local following = false
local attacking = false

function onThingMove(creature, thing, oldpos, oldstackpos)

end


function onCreatureAppear(creature)

end


function onCreatureDisappear(cid, pos)
  	if focus == cid then
          selfSay('Good bye then.')
          focus = 0
          talk_start = 0
  	end
end


function onCreatureTurn(creature)

end

function msgcontains(txt, str)
  	return (string.find(txt, str) and not string.find(txt, '(%w+)' .. str) and not string.find(txt, str .. '(%w+)'))
end


function onCreatureSay(cid, type, msg)
  	msg = string.lower(msg)

  	if (msgcontains(msg, 'hi') and focus == 0) and getDistanceToCreature(cid) < 4 then
  		selfSay('Hello ' .. creatureGetName(cid) .. '! I sell scarfs (1k) and aols (10k).')
  		focus = cid
  		talk_start = os.clock()

  	elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
  		selfSay('Sorry, ' .. creatureGetName(cid) .. '! I talk to you in a minute.')

  	elseif focus == cid then
		talk_start = os.clock()

		if msgcontains(msg, 'aol') then
			buy(cid,2173,1,10000)
		elseif msgcontains(msg, 'scarf') then
			buy(cid,2661,1,1000)

		elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
			selfSay('Good bye, ' .. creatureGetName(cid) .. '!')
			focus = 0
			talk_start = 0
		end
  	end
end


function onCreatureChangeOutfit(creature)

end


function onThink()
  	if (os.clock() - talk_start) > 30 then
  		if focus > 0 then
  			selfSay('Next Please...')
  		end
 		focus = 0
  	end
 	if focus ~= 0 then
 		if getDistanceToCreature(focus) > 5 then
 			selfSay('Good bye then.')
 			focus = 0
 		end
 	end
end

 

 

 

erro reset.jpg

Postado
  • Autor
Spoiler

 

Isolda.XML


<npc name="Isolda" script="data/npc/scripts/aols.lua" autowalk="0" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="140" head="38" body="50" legs="79" feet="66" corpse="3128" addons="0"/>
	<parameters>
	<parameter key="message_greet" value="Hi |PLAYERNAME|, EU FABRICO AOL DIGA: (NECKLACE) (AMULET) (MAGIC) - ENERGYZO SEU AOL DIGA: (ENERGYZE) PROMOVO SEU PERSONAGEM A DEUS E RESETO SEU PERSONAGEM DIGA: (RESET) - E VENDO AOL JA ENERGYZADOS DIGA: (AOL1), (AOL2), (AOL3) ME DIGA OQUE PRECISA ?" />
	</parameters>
</npc>

 

 

 

Spoiler

Aols.XML

 



--------------------------------------------------------------------------------------------
------------------------------------ Advanced Addon NPC ------------------------------------
-------------------------------- Script made by teh_pwnage ---------------------------------
--------------- Special thanks to: mokerhamer, Xidaozu and Jiddo, deaths'life --------------
------------------------------- Thanks also to everyone else -------------------------------
------------------------------ NPC based on Evolutions V0.7.7 ------------------------------
--------------------------------------------------------------------------------------------

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

-- OTServ event handling functions start
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


-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	if(npcHandler.focus ~= cid) then
		return false
	end

	preco = getPlayerLevel(cid)*3
    	bless = getPlayerBlessing(cid,1)
	vezes = getResets(cid)
	rubys = (getPlayerLevel(cid)*4000)*(vezes*30*2)/1000000
	
		if msgcontains(msg, 'necklace') then
			selfSay('I only need a mysterious, dragon breath, scorpion, platinum, fluids and vampire tooth, accept change all for a Elemental necklace?')
			talk_state = 1

		elseif msgcontains(msg, 'amulet') then
			selfSay('I only need a Ialamar, frozzen, sickness, Samantha, Mastafar, priest and eletric, accept change all for a Spirit Elemental amulet?')
			talk_state = 2

		elseif msgcontains(msg, 'magic') then
			selfSay('I only need a Merlian, relic of the hell, Broonier, Thordain, dark wyzard, angel and gaya, accept change all for a Elemental magic amulet?')
			talk_state = 3

		elseif msgcontains(msg, 'energyze') then
			selfSay('I can energyze your necklace for 50k, amulet for 100k or your magic amulet for 150k, do you want energyze?')
			talk_state = 4

		elseif msgcontains(msg, 'bless') or msgcontains(msg, 'blessing') then
			selfSay('Bless a mortal? Hmm... Sure I can bless, but it will not be cheap, what do you say about ' .. preco .. 'k?')
			talk_state = 5

		elseif msgcontains(msg, 'reset') then
		if vezes == -1 or vezes == 0 then
			selfSay('Reset a god? Hmm... First time? Ok, i will do it free this time!')
			talk_state = 6
		else
			selfSay('Reset a god? Hmm... Sure I can, but it will not be cheap, what do you say about ' .. rubys .. ' ruby coins?')
			talk_state = 6
		end
		
				elseif msgcontains(msg, 'aol1') then
			selfSay('Aceita trocar 10 Ruby Coins por 1 Elemental Necklace?')
			talk_state = 7
			
							elseif msgcontains(msg, 'aol2') then
			selfSay('Aceita trocar 15 Ruby Coins por 1 Spirit Elemental Amulet?')
			talk_state = 8
			
							elseif msgcontains(msg, 'aol3') then
			selfSay('Aceita trocar 25 Ruby Coins por 1 Elemental Magic Amulet?')
			talk_state = 9

		
		elseif msgcontains(msg, 'job') then
			selfSay('I am a servent of Merlian!')

		elseif msgcontains(msg, 'offer') then
			selfSay('I can do an element item or energyze your element item, i only need all "necklace", "amulet" ou "magic" amulet, also can bless a little mortal and reset a god!')

		elseif msgcontains(msg, 'sell') then
			selfSay('I am not a merchant!')

		elseif msgcontains(msg, 'buy') then
			selfSay('I am not a merchant!')

		elseif msgcontains(msg, 'quest') then
			selfSay('Ha! You are only a novice!')

		elseif msgcontains(msg, 'mission') then
			selfSay('Ha! You are only a novice!')

-- neck
	elseif talk_state == 1 then
	if msgcontains(msg, 'yes') then
		if getPlayerItemCount(cid,2198) >= 1 and getPlayerItemCount(cid,2161) >= 1 and getPlayerItemCount(cid,2170) >= 1 and getPlayerItemCount(cid,2171) >= 1 and getPlayerItemCount(cid,2172) >= 1 and getPlayerItemCount(cid,2201) >= 1 then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu um Elemental necklace.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2198,1)
			doPlayerRemoveItem(cid,2161,1)
			doPlayerRemoveItem(cid,2170,1)
			doPlayerRemoveItem(cid,2171,1)
			doPlayerRemoveItem(cid,2172,1)
			doPlayerRemoveItem(cid,2201,1)
			doPlayerAddItem(cid,2197,1)
			talk_state = 0
			else
			selfSay('You dont have this itens!')
			talk_state = 0
			end
		end
-- amulet

	elseif talk_state == 2 then
	if msgcontains(msg, 'yes') then
		if getPlayerItemCount(cid,2129) >= 1 and getPlayerItemCount(cid,2133) >= 1 and getPlayerItemCount(cid,2130) >= 1 and getPlayerItemCount(cid,2199) >= 1 and getPlayerItemCount(cid,2135) >= 1 and getPlayerItemCount(cid,2126) >= 1 and getPlayerItemCount(cid,2131) >= 1 then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu um Spirit Elemental amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2129,1)
			doPlayerRemoveItem(cid,2133,1)
			doPlayerRemoveItem(cid,2130,1)
			doPlayerRemoveItem(cid,2199,1)
			doPlayerRemoveItem(cid,2135,1)
			doPlayerRemoveItem(cid,2126,1)
			doPlayerRemoveItem(cid,2131,1)
			doPlayerAddItem(cid,2173,1)
			talk_state = 0
			else
			selfSay('You dont have this itens!')
			talk_state = 5
			end
		end

	elseif talk_state == 3 then
	if msgcontains(msg, 'yes') then
		if getPlayerItemCount(cid,2218) >= 1 and getPlayerItemCount(cid,2142) >= 1 and getPlayerItemCount(cid,2132) >= 1 and getPlayerItemCount(cid,2136) >= 1 and getPlayerItemCount(cid,2138) >= 1 and getPlayerItemCount(cid,2200) >= 1 and getPlayerItemCount(cid,2196) >= 1 then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu um Elemental magic amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2218,1)
			doPlayerRemoveItem(cid,2142,1)
			doPlayerRemoveItem(cid,2132,1)
			doPlayerRemoveItem(cid,2136,1)
			doPlayerRemoveItem(cid,2138,1)
			doPlayerRemoveItem(cid,2200,1)
			doPlayerRemoveItem(cid,2196,1)
			doPlayerAddItem(cid,2125,1)
			talk_state = 0
			else
			selfSay('You dont have this itens!')
			talk_state = 5
			end
		end
		
				elseif talk_state == 7 and msgcontains(msg, 'yes') then	-- ftxp
		if getPlayerItemCount(cid,13685) >= 10 then
			doPlayerTakeItem(cid,13685,10)
			selfSay('Aqui esta! Obrigado e volte sempre.')
			doPlayerSendTextMessage(cid,22,"Voce recebeu 1 Elemental Necklace.")
			doPlayerAddItem(cid, 13682, 1)
			talk_state = 0
		else
			selfSay('Desculpe, mas voce não tem Dinheiro suficiente.')
		end
		
						elseif talk_state == 8 and msgcontains(msg, 'yes') then	-- ftxp
		if getPlayerItemCount(cid,13685) >= 15 then
			doPlayerTakeItem(cid,13685,15)
			selfSay('Aqui esta! Obrigado e volte sempre.')
			doPlayerSendTextMessage(cid,22,"Voce recebeu 1 Spirit Elemental Amulet.")
			doPlayerAddItem(cid, 13683, 1)
			talk_state = 0
		else
			selfSay('Desculpe, mas voce não tem Dinheiro suficiente.')
		end
		
						elseif talk_state == 9 and msgcontains(msg, 'yes') then	-- ftxp
		if getPlayerItemCount(cid,13685) >= 25 then
			doPlayerTakeItem(cid,13685,25)
			selfSay('Aqui esta! Obrigado e volte sempre.')
			doPlayerSendTextMessage(cid,22,"Voce recebeu 1 Elemental Magic Amulet.")
			doPlayerAddItem(cid, 13684, 1)
			talk_state = 0
		else
			selfSay('Desculpe, mas voce não tem Dinheiro suficiente.')
		end
-- energ

	elseif talk_state == 4 then
	if msgcontains(msg, 'yes') and getPlayerItemCount(cid,2197) >= 1 then
		if pay(cid,50000) then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu Energizou seu Elemental necklace.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2197,1)
			doPlayerAddItem(cid,13682,1)
			talk_state = 0
			else
			selfSay('You dont have this money!')
			talk_state = 0
			end

	elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,2173) >= 1 then
		if pay(cid,100000) then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu Energizou seu Spirit Elemental amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2173,1)
			doPlayerAddItem(cid,13683,1)
			talk_state = 0
			else
			selfSay('You dont have this money!')
			talk_state = 0
			end

	elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,2125) >= 1 then
		if pay(cid,150000) then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu Energizou seu Elemental magic amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2125,1)
			doPlayerAddItem(cid,13684,1)
			talk_state = 0
			else
			selfSay('You dont have this money!')
			talk_state = 0
			end

	elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,2197) >= 0 and getPlayerItemCount(cid,2125) >= 0 and getPlayerItemCount(cid,2173) >= 0 then
			selfSay('You dont have this item!')
			talk_state = 0



		end

-- bless

	elseif talk_state == 5 then
	if msgcontains(msg, 'yes') then
	if bless then
		selfSay('You are already blessed my little mortal.')
		talk_state = 0
		else
        if isPremium(cid) then
	if pay(cid,preco*1000) then
		selfSay('Receive this bless mortal, with the gods touch i bless you!')
		doPlayerSendTextMessage(cid,22,"Voce recebeu a benção de Isolda.")
                doPlayerAddBlessing(cid, 1)
                doPlayerAddBlessing(cid, 2)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry but only can bless a mortal premmy.')
		talk_state = 0
		end

		end
		end

-- reset

	elseif talk_state == 6 then
	--rubys = (getPlayerLevel(cid)*4000)*(vezes*10)/1000000)
	if msgcontains(msg, 'yes') then
        if isPremium(cid) then
        if getPlayerLevel(cid) >= 500 then
        if getPlayerVocation(cid) >= 9 then
	--if pay(cid,(getPlayerLevel(cid)*4000)*(vezes*10)) then
	

        if getPlayerVocation(cid) == 13 then	-- deuses
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
		doPlayerAddMagicLevel(cid,25)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end
        if getPlayerVocation(cid) == 14 then
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
		doPlayerAddMagicLevel(cid,25)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end
        if getPlayerVocation(cid) == 15 then
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
           
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
		doPlayerAddMagicLevel(cid,4)
		doPlayerAddSkill(cid,4,20) 
		doPlayerAddSkill(cid,5,20) 
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end

        if getPlayerVocation(cid) == 16 then
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
doPlayerAddMagicLevel(cid,1)
		doPlayerAddSkill(cid,0,20) 
		doPlayerAddSkill(cid,1,20) 
		doPlayerAddSkill(cid,2,20) 
		doPlayerAddSkill(cid,3,20) 
		doPlayerAddSkill(cid,5,20) 
doPlayerAddMagicLevel(cid,2)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end

	if getResets(cid) <= 0 and getPlayerVocation(cid) >= 13 and getPlayerLevel(cid) >= 500 then
		setPlayerStorageValue(cid,7777,1)
	end
	
        if getPlayerVocation(cid) >= 9 and getPlayerVocation(cid) < 13 then	-- semis
	if getPlayerItemCount(cid,13685) >= 5 then
		selfSay('Oh! Now you are a god!')

        	if getPlayerVocation(cid) >= 9 and getPlayerVocation(cid) < 11 then
		doPlayerAddMagicLevel(cid,20)
           setPlayerMaxCapacity(cid,360)
		end
        	if getPlayerVocation(cid) == 11 then
		doPlayerAddMagicLevel(cid,4)
		doPlayerAddSkill(cid,4,20)
		doPlayerAddSkill(cid,5,20)
           setPlayerMaxCapacity(cid,360)
		end
        	if getPlayerVocation(cid) == 12 then
           doPlayerAddSkill(cid,0,20)
           doPlayerAddSkill(cid,1,20)
           doPlayerAddSkill(cid,2,20)
           doPlayerAddSkill(cid,3,20)
           doPlayerAddSkill(cid,5,20)
doPlayerAddMagicLevel(cid,1)
           setPlayerMaxCapacity(cid,360)
		end

		doPlayerSendTextMessage(cid,22,"Você evoluiu seu espírito a Deus.")
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid,185)
		doPlayerAddHealth(cid,185)
		setPlayerMaxMana(cid,35)
		doPlayerAddMana(cid,35)
		doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerRemoveItem(cid,13685,5)
		talk_state = 0

		else
		selfSay('Sorry, but you dont have the 5 ruby coins!')
		talk_state = 0
		end
	end

		else
		selfSay('Sorry, but only gods i can do that!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
		else
		selfSay('Sorry but only can reset a god premmy.')
		talk_state = 0
		end

		end
		--end

------------------------------------------------ confirm no ------------------------------------------------
		elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 34) then
			selfSay('Ok than.')
			talk_state = 0
		end
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	return true
end

function teste(cid)

end

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

 

 

@Roy , está ai, qualquer coisa que precisar, me avise que te respondo o mais rapido possivel !!!

 

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

  • 11 months later...
Postado
Em 07/01/2018 em 12:13, Micheel15 disse:
  Ocultar conteúdo

 

Isolda.XML



<npc name="Isolda" script="data/npc/scripts/aols.lua" autowalk="0" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="140" head="38" body="50" legs="79" feet="66" corpse="3128" addons="0"/>
	<parameters>
	<parameter key="message_greet" value="Hi |PLAYERNAME|, EU FABRICO AOL DIGA: (NECKLACE) (AMULET) (MAGIC) - ENERGYZO SEU AOL DIGA: (ENERGYZE) PROMOVO SEU PERSONAGEM A DEUS E RESETO SEU PERSONAGEM DIGA: (RESET) - E VENDO AOL JA ENERGYZADOS DIGA: (AOL1), (AOL2), (AOL3) ME DIGA OQUE PRECISA ?" />
	</parameters>
</npc>

 

 

 

  Ocultar conteúdo

Aols.XML

 




--------------------------------------------------------------------------------------------
------------------------------------ Advanced Addon NPC ------------------------------------
-------------------------------- Script made by teh_pwnage ---------------------------------
--------------- Special thanks to: mokerhamer, Xidaozu and Jiddo, deaths'life --------------
------------------------------- Thanks also to everyone else -------------------------------
------------------------------ NPC based on Evolutions V0.7.7 ------------------------------
--------------------------------------------------------------------------------------------

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

-- OTServ event handling functions start
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


-- OTServ event handling functions end

function creatureSayCallback(cid, type, msg)
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	if(npcHandler.focus ~= cid) then
		return false
	end

	preco = getPlayerLevel(cid)*3
    	bless = getPlayerBlessing(cid,1)
	vezes = getResets(cid)
	rubys = (getPlayerLevel(cid)*4000)*(vezes*30*2)/1000000
	
		if msgcontains(msg, 'necklace') then
			selfSay('I only need a mysterious, dragon breath, scorpion, platinum, fluids and vampire tooth, accept change all for a Elemental necklace?')
			talk_state = 1

		elseif msgcontains(msg, 'amulet') then
			selfSay('I only need a Ialamar, frozzen, sickness, Samantha, Mastafar, priest and eletric, accept change all for a Spirit Elemental amulet?')
			talk_state = 2

		elseif msgcontains(msg, 'magic') then
			selfSay('I only need a Merlian, relic of the hell, Broonier, Thordain, dark wyzard, angel and gaya, accept change all for a Elemental magic amulet?')
			talk_state = 3

		elseif msgcontains(msg, 'energyze') then
			selfSay('I can energyze your necklace for 50k, amulet for 100k or your magic amulet for 150k, do you want energyze?')
			talk_state = 4

		elseif msgcontains(msg, 'bless') or msgcontains(msg, 'blessing') then
			selfSay('Bless a mortal? Hmm... Sure I can bless, but it will not be cheap, what do you say about ' .. preco .. 'k?')
			talk_state = 5

		elseif msgcontains(msg, 'reset') then
		if vezes == -1 or vezes == 0 then
			selfSay('Reset a god? Hmm... First time? Ok, i will do it free this time!')
			talk_state = 6
		else
			selfSay('Reset a god? Hmm... Sure I can, but it will not be cheap, what do you say about ' .. rubys .. ' ruby coins?')
			talk_state = 6
		end
		
				elseif msgcontains(msg, 'aol1') then
			selfSay('Aceita trocar 10 Ruby Coins por 1 Elemental Necklace?')
			talk_state = 7
			
							elseif msgcontains(msg, 'aol2') then
			selfSay('Aceita trocar 15 Ruby Coins por 1 Spirit Elemental Amulet?')
			talk_state = 8
			
							elseif msgcontains(msg, 'aol3') then
			selfSay('Aceita trocar 25 Ruby Coins por 1 Elemental Magic Amulet?')
			talk_state = 9

		
		elseif msgcontains(msg, 'job') then
			selfSay('I am a servent of Merlian!')

		elseif msgcontains(msg, 'offer') then
			selfSay('I can do an element item or energyze your element item, i only need all "necklace", "amulet" ou "magic" amulet, also can bless a little mortal and reset a god!')

		elseif msgcontains(msg, 'sell') then
			selfSay('I am not a merchant!')

		elseif msgcontains(msg, 'buy') then
			selfSay('I am not a merchant!')

		elseif msgcontains(msg, 'quest') then
			selfSay('Ha! You are only a novice!')

		elseif msgcontains(msg, 'mission') then
			selfSay('Ha! You are only a novice!')

-- neck
	elseif talk_state == 1 then
	if msgcontains(msg, 'yes') then
		if getPlayerItemCount(cid,2198) >= 1 and getPlayerItemCount(cid,2161) >= 1 and getPlayerItemCount(cid,2170) >= 1 and getPlayerItemCount(cid,2171) >= 1 and getPlayerItemCount(cid,2172) >= 1 and getPlayerItemCount(cid,2201) >= 1 then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu um Elemental necklace.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2198,1)
			doPlayerRemoveItem(cid,2161,1)
			doPlayerRemoveItem(cid,2170,1)
			doPlayerRemoveItem(cid,2171,1)
			doPlayerRemoveItem(cid,2172,1)
			doPlayerRemoveItem(cid,2201,1)
			doPlayerAddItem(cid,2197,1)
			talk_state = 0
			else
			selfSay('You dont have this itens!')
			talk_state = 0
			end
		end
-- amulet

	elseif talk_state == 2 then
	if msgcontains(msg, 'yes') then
		if getPlayerItemCount(cid,2129) >= 1 and getPlayerItemCount(cid,2133) >= 1 and getPlayerItemCount(cid,2130) >= 1 and getPlayerItemCount(cid,2199) >= 1 and getPlayerItemCount(cid,2135) >= 1 and getPlayerItemCount(cid,2126) >= 1 and getPlayerItemCount(cid,2131) >= 1 then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu um Spirit Elemental amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2129,1)
			doPlayerRemoveItem(cid,2133,1)
			doPlayerRemoveItem(cid,2130,1)
			doPlayerRemoveItem(cid,2199,1)
			doPlayerRemoveItem(cid,2135,1)
			doPlayerRemoveItem(cid,2126,1)
			doPlayerRemoveItem(cid,2131,1)
			doPlayerAddItem(cid,2173,1)
			talk_state = 0
			else
			selfSay('You dont have this itens!')
			talk_state = 5
			end
		end

	elseif talk_state == 3 then
	if msgcontains(msg, 'yes') then
		if getPlayerItemCount(cid,2218) >= 1 and getPlayerItemCount(cid,2142) >= 1 and getPlayerItemCount(cid,2132) >= 1 and getPlayerItemCount(cid,2136) >= 1 and getPlayerItemCount(cid,2138) >= 1 and getPlayerItemCount(cid,2200) >= 1 and getPlayerItemCount(cid,2196) >= 1 then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu um Elemental magic amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2218,1)
			doPlayerRemoveItem(cid,2142,1)
			doPlayerRemoveItem(cid,2132,1)
			doPlayerRemoveItem(cid,2136,1)
			doPlayerRemoveItem(cid,2138,1)
			doPlayerRemoveItem(cid,2200,1)
			doPlayerRemoveItem(cid,2196,1)
			doPlayerAddItem(cid,2125,1)
			talk_state = 0
			else
			selfSay('You dont have this itens!')
			talk_state = 5
			end
		end
		
				elseif talk_state == 7 and msgcontains(msg, 'yes') then	-- ftxp
		if getPlayerItemCount(cid,13685) >= 10 then
			doPlayerTakeItem(cid,13685,10)
			selfSay('Aqui esta! Obrigado e volte sempre.')
			doPlayerSendTextMessage(cid,22,"Voce recebeu 1 Elemental Necklace.")
			doPlayerAddItem(cid, 13682, 1)
			talk_state = 0
		else
			selfSay('Desculpe, mas voce não tem Dinheiro suficiente.')
		end
		
						elseif talk_state == 8 and msgcontains(msg, 'yes') then	-- ftxp
		if getPlayerItemCount(cid,13685) >= 15 then
			doPlayerTakeItem(cid,13685,15)
			selfSay('Aqui esta! Obrigado e volte sempre.')
			doPlayerSendTextMessage(cid,22,"Voce recebeu 1 Spirit Elemental Amulet.")
			doPlayerAddItem(cid, 13683, 1)
			talk_state = 0
		else
			selfSay('Desculpe, mas voce não tem Dinheiro suficiente.')
		end
		
						elseif talk_state == 9 and msgcontains(msg, 'yes') then	-- ftxp
		if getPlayerItemCount(cid,13685) >= 25 then
			doPlayerTakeItem(cid,13685,25)
			selfSay('Aqui esta! Obrigado e volte sempre.')
			doPlayerSendTextMessage(cid,22,"Voce recebeu 1 Elemental Magic Amulet.")
			doPlayerAddItem(cid, 13684, 1)
			talk_state = 0
		else
			selfSay('Desculpe, mas voce não tem Dinheiro suficiente.')
		end
-- energ

	elseif talk_state == 4 then
	if msgcontains(msg, 'yes') and getPlayerItemCount(cid,2197) >= 1 then
		if pay(cid,50000) then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu Energizou seu Elemental necklace.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2197,1)
			doPlayerAddItem(cid,13682,1)
			talk_state = 0
			else
			selfSay('You dont have this money!')
			talk_state = 0
			end

	elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,2173) >= 1 then
		if pay(cid,100000) then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu Energizou seu Spirit Elemental amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2173,1)
			doPlayerAddItem(cid,13683,1)
			talk_state = 0
			else
			selfSay('You dont have this money!')
			talk_state = 0
			end

	elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,2125) >= 1 then
		if pay(cid,150000) then
			selfSay('Its all yours!')
			doPlayerSendTextMessage(cid,22,"Voce recebeu Energizou seu Elemental magic amulet.")
  			doSendMagicEffect(getPlayerPosition(cid),12)
			doPlayerRemoveItem(cid,2125,1)
			doPlayerAddItem(cid,13684,1)
			talk_state = 0
			else
			selfSay('You dont have this money!')
			talk_state = 0
			end

	elseif msgcontains(msg, 'yes') and getPlayerItemCount(cid,2197) >= 0 and getPlayerItemCount(cid,2125) >= 0 and getPlayerItemCount(cid,2173) >= 0 then
			selfSay('You dont have this item!')
			talk_state = 0



		end

-- bless

	elseif talk_state == 5 then
	if msgcontains(msg, 'yes') then
	if bless then
		selfSay('You are already blessed my little mortal.')
		talk_state = 0
		else
        if isPremium(cid) then
	if pay(cid,preco*1000) then
		selfSay('Receive this bless mortal, with the gods touch i bless you!')
		doPlayerSendTextMessage(cid,22,"Voce recebeu a benção de Isolda.")
                doPlayerAddBlessing(cid, 1)
                doPlayerAddBlessing(cid, 2)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry but only can bless a mortal premmy.')
		talk_state = 0
		end

		end
		end

-- reset

	elseif talk_state == 6 then
	--rubys = (getPlayerLevel(cid)*4000)*(vezes*10)/1000000)
	if msgcontains(msg, 'yes') then
        if isPremium(cid) then
        if getPlayerLevel(cid) >= 500 then
        if getPlayerVocation(cid) >= 9 then
	--if pay(cid,(getPlayerLevel(cid)*4000)*(vezes*10)) then
	

        if getPlayerVocation(cid) == 13 then	-- deuses
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
		doPlayerAddMagicLevel(cid,25)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end
        if getPlayerVocation(cid) == 14 then
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
		doPlayerAddMagicLevel(cid,25)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end
        if getPlayerVocation(cid) == 15 then
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
           
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
		doPlayerAddMagicLevel(cid,4)
		doPlayerAddSkill(cid,4,20) 
		doPlayerAddSkill(cid,5,20) 
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end

        if getPlayerVocation(cid) == 16 then
        if getPlayerLevel(cid) >= 500 then
	if getPlayerItemCount(cid,13685) >= rubys then
		selfSay('Welcome new god!')
		doPlayerSendTextMessage(cid,22,"Você resetou seu personagem.")
		health = getPlayerMaxHealth(cid)
		mana = getPlayerMaxMana(cid)
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid, (health/10)*(vezes+1))
		doPlayerAddHealth(cid,(health/10)*(vezes+1))
		setPlayerMaxMana(cid, (mana/15)*(vezes+1))
		doPlayerAddMana(cid,(mana/15)*(vezes+1))
           setPlayerMaxCapacity(cid,360)
doPlayerAddMagicLevel(cid,1)
		doPlayerAddSkill(cid,0,20) 
		doPlayerAddSkill(cid,1,20) 
		doPlayerAddSkill(cid,2,20) 
		doPlayerAddSkill(cid,3,20) 
		doPlayerAddSkill(cid,5,20) 
doPlayerAddMagicLevel(cid,2)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerAddResets(cid,1)
		doPlayerRemoveItem(cid,13685,rubys)
		talk_state = 0
		else
		selfSay('Sorry mortal, but you dont have this monney!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
	end

	if getResets(cid) <= 0 and getPlayerVocation(cid) >= 13 and getPlayerLevel(cid) >= 500 then
		setPlayerStorageValue(cid,7777,1)
	end
	
        if getPlayerVocation(cid) >= 9 and getPlayerVocation(cid) < 13 then	-- semis
	if getPlayerItemCount(cid,13685) >= 5 then
		selfSay('Oh! Now you are a god!')

        	if getPlayerVocation(cid) >= 9 and getPlayerVocation(cid) < 11 then
		doPlayerAddMagicLevel(cid,20)
           setPlayerMaxCapacity(cid,360)
		end
        	if getPlayerVocation(cid) == 11 then
		doPlayerAddMagicLevel(cid,4)
		doPlayerAddSkill(cid,4,20)
		doPlayerAddSkill(cid,5,20)
           setPlayerMaxCapacity(cid,360)
		end
        	if getPlayerVocation(cid) == 12 then
           doPlayerAddSkill(cid,0,20)
           doPlayerAddSkill(cid,1,20)
           doPlayerAddSkill(cid,2,20)
           doPlayerAddSkill(cid,3,20)
           doPlayerAddSkill(cid,5,20)
doPlayerAddMagicLevel(cid,1)
           setPlayerMaxCapacity(cid,360)
		end

		doPlayerSendTextMessage(cid,22,"Você evoluiu seu espírito a Deus.")
		doPlayerAbortExp(cid,getPlayerExperience(cid))
           doPlayerIncExp(cid,4200)
		setPlayerMaxHealth(cid,185)
		doPlayerAddHealth(cid,185)
		setPlayerMaxMana(cid,35)
		doPlayerAddMana(cid,35)
		doPlayerSetVocation(cid, getPlayerVocation(cid)+4)
  		doSendMagicEffect(getPlayerPosition(cid),12)
		doPlayerRemoveItem(cid,13685,5)
		talk_state = 0

		else
		selfSay('Sorry, but you dont have the 5 ruby coins!')
		talk_state = 0
		end
	end

		else
		selfSay('Sorry, but only gods i can do that!')
		talk_state = 0
		end
		else
		selfSay('Sorry, but only gods level 500 or above can do that!')
		talk_state = 0
		end
		else
		selfSay('Sorry but only can reset a god premmy.')
		talk_state = 0
		end

		end
		--end

------------------------------------------------ confirm no ------------------------------------------------
		elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 34) then
			selfSay('Ok than.')
			talk_state = 0
		end
	-- Place all your code in here. Remember that hi, bye and all that stuff is already handled by the npcsystem, so you do not have to take care of that yourself.
	return true
end

function teste(cid)

end

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

 

 

@Roy , está ai, qualquer coisa que precisar, me avise que te respondo o mais rapido possivel !!!

 

 

 

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

Quem Está Navegando 0

  • Nenhum usuário registrado visualizando esta página.

Estatísticas dos Fóruns

  • Tópicos 96.9k
  • Posts 519.7k

Informação Importante

Confirmação de Termo