Npc Que Troca Soft Boots

Akatsuki0
em NPCs, monsters e raids

Akatsuki0

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 14/03/08Posts: 8

um NPC que troca worn soft boots por uma brand-new soft boots

=)

 

 

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

function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
	return false
end

	if msgcontains(msg, 'specialised') or msgcontains(msg, 'boot') then
		selfSay('Yes, my fathers was a great one blacksmith, it was a wise person , but when he decided to teach me he dies and i just learn about the lovely boots. So, did you bring me some boots? which one?')
	elseif msgcontains(msg, 'soft boots') or msgcontains(msg, 'worn soft boots') or msgcontains(msg, 'soft boot') or msgcontains(msg, 'worn soft boot') or msgcontains(msg, 'worn') then
		selfSay('Did u like that i fix ur worn soft boots? it will cost 100 platinum coins')
		talk_state = 1

elseif msgcontains(msg, 'yes') and talk_state == 1 then
		if getPlayerItemCount(cid,6530) >= 1 and getPlayerItemCount(cid,2152) >= 100 or getPlayerItemCount(cid,2160) >= 1 then
		   selfSay('Here is your brand-new soft boots!.')
				   doPlayerTakeItem(cid, 6530, 1)
				doPlayerRemoveMoney(cid,[size="4"][color="#FF0000"]10000[/color][/size])
				doPlayerAddItem(cid,2640,1)
		else
			selfSay('Sorry, you don\'t have the item.')
		end

elseif msgcontains(msg, 'no') and (talk_state >= 1 and talk_state <= 5) then
		selfSay('Ok than.')
		talk_state = 0
	end
return true
end

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

 

vocês podem mudar quanto custa para trocar a worn soft boots por outro preço (agora ta 10000)

se tiver algo errado, comentem


LOL

1 Post [X] :)
25 posts [ ]
50 posts [ ]
100 posts [ ]
200 posts [ ]
300 posts [ ]
400 posts [ ]
500 posts [ ]
700 posts [ ]
850 posts [ ]
1000 posts [ ]
10000 posts [ ]

Tapetao

avatar
Campones
Campones

INFOS

Grupo: CamponesRegistrado: 26/04/08Posts: 49

blz, mas aonde faiz isso ?? em q lugar

Fan Bars