Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local keywordHandler = KeywordHandler:new()
- local shopModule = ShopModule: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
- msg = string.lower(msg)
- if msgcontains(msg, 'teleport me to') or msgcontains(msg, 'teleport me to') then
- if msgcontains(msg, 'Konoha') then
- to_destinationz = {cost = 1000, toPosition = {x=653, y=562, z=6}, premium = 0}
- elseif msgcontains(msg, 'Suna') then
- to_destinationz = {cost = 1000, toPosition = {x=227, y=490, z=6}, premium = 0}
- elseif msgcontains(msg, 'Pirate Island') then
- to_destinationz = {cost = 1000, toPosition = {x=986, y=639, z=6}, premium = 0}
- elseif msgcontains(msg, 'Winter Island') then
- to_destinationz = {cost = 1000, toPosition = {x=581, y=76, z=7}, premium = 0}
- elseif msgcontains(msg, 'Ryuchi Cave') then
- to_destinationz = {cost = 1000, toPosition = {x=554, y=207, z=7}, premium = 0}
- elseif msgcontains(msg, 'Katsuyu Rock') then
- to_destinationz = {cost = 1000, toPosition = {x=533, y=361, z=4}, premium = 0}
- elseif msgcontains(msg, 'Myoboku Island') then
- to_destinationz = {cost = 1000, toPosition = {x=970, y=251, z=8}, premium = 0}
- elseif msgcontains(msg, 'Edo Island') then
- to_destinationz = {cost = 1000, toPosition = {x=1082, y=104, z=7}, premium = 0}
- elseif msgcontains(msg, 'Legendary Pallace') then
- to_destinationz = {cost = 1000, toPosition = {x=497, y=514, z=7}, premium = 0}
- elseif msgcontains(msg, 'Akatsuki Hide') then
- to_destinationz = {cost = 1000, toPosition = {x=559, y=713, z=5}, premium = 0}
- else
- return true
- end
- if(getPlayerPremiumDays(cid) > 0 or to_destinationz.premium == 0) then
- if(doPlayerRemoveMoney(cid, to_destinationz.cost) == TRUE) then
- doTeleportThing(cid, to_destinationz.toPosition, 0)
- doSendMagicEffect(to_destinationz.toPosition, 10)
- end
- end
- end
- return true
- end
- npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
- npcHandler:addModule(FocusModule:new())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement