gr33nd3v1l
You see a Green Devil.
My idea was to make a quest of this sort:
You need to talk to the old pirate, ask him about pirates and he tells you to go find a drunk pirate somewhere on the island. When you find him, he is scared of you and yells "Ghost!", at that moment a storage value is added on the player. When you come back to the old pirate he gives you a hat and tells you to find Jack, the captain. When you find jack you complete the quest and receive a pirate shirt, boots, hook, peg leg, eye patch and those blue pirate briefs.
This is what i managed to compile on my own, i am using Jiddo's npc system i think.
This is the drunk pirate, he isn't supposed to talk to you, only add a storagevalue and yell help every time you say hi.
This is the old pirate.
And sice these 2 didn't work together, i havent even started on Jack
Oh and i only compiled this using common sense, logic thinking, and other npc scripts. I am no scripter so be gentle with the flaming please =\
You need to talk to the old pirate, ask him about pirates and he tells you to go find a drunk pirate somewhere on the island. When you find him, he is scared of you and yells "Ghost!", at that moment a storage value is added on the player. When you come back to the old pirate he gives you a hat and tells you to find Jack, the captain. When you find jack you complete the quest and receive a pirate shirt, boots, hook, peg leg, eye patch and those blue pirate briefs.
This is what i managed to compile on my own, i am using Jiddo's npc system i think.
This is the drunk pirate, he isn't supposed to talk to you, only add a storagevalue and yell help every time you say hi.
Code:
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('Hicks!')
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('You\'s aa.. Pirate? No\'s you.. You\'s a ghost! Help! HEELP!')
focus == cid
setPlayerStorageValue(cid, 7667)
focus == 0
elseif msgcontains(msg, 'hi') and (focus ~= cid) and getDistanceToCreature(cid) < 4 then
selfSay('Hicks!')
elseif msgcontains(msg, 'bye') and getDistanceToCreature(cid) < 4 then
selfSay('Hicks!')
focus = 0
talk_start = 0
end
end
function onCreatureChangeOutfit(creature)
end
function onThink()
if focus > 0 then
x, y, z = creatureGetPosition(focus)
myx, myy, myz = selfGetPosition()
if ((myy-y==0) and (myx-x<=0 and myx-x>=-4)) then
selfTurn(1)
end
if ((myy-y==0) and (myx-x>=0 and myx-x<=4)) then
selfTurn(3)
end
if ((myx-x==0) and (myy-y<=0 and myy-y>=-4)) then
selfTurn(2)
end
if ((myx-x==0) and (myy-y>=0 and myy-y<=4)) then
selfTurn(0)
end
if ((myy-y==-2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(2)
end
if ((myy-y==2) and (myx-x>=-1 and myx-x<=1)) then
selfTurn(0)
end
if ((myx-x==2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(3)
end
if ((myx-x==-2) and (myy-y>=-1 and myy-y<=1)) then
selfTurn(1)
end
if ((myy-y==-3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(2)
end
if ((myy-y==3) and (myx-x>=-2 and myx-x<=2)) then
selfTurn(0)
end
if ((myx-x==3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(3)
end
if ((myx-x==-3) and (myy-y>=-2 and myy-y<=2)) then
selfTurn(1)
end
if ((myy-y==-4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(2)
end
if ((myy-y==4) and (myx-x>=-3 and myx-x<=3)) then
selfTurn(0)
end
if ((myx-x==4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(3)
end
if ((myx-x==-4) and (myy-y>=-3 and myy-y<=3)) then
selfTurn(1)
end
end
end
This is the old pirate.
Code:
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
npcHandler:addModule(FocusModule:new())
function creatureSayCallback(cid, type, msg)
if(npcHandler.focus ~= cid) then
return false
end
if msgcontains(msg, 'pirate') then
if getPlayerStorageValue(cid, 7667) == -1 then
selfSay('Well now, ' .. getCreatureName(cid) .. '! You do look like a pirate, maybe if you do something like a pirate you can be one! Pirates must be explorers, see if you can find a Drunk Pirate around here.')
else
if getPlayerStorageValue(cid, 7668) == -1 then
selfSay('Good, very good. Find Jack somewhere here and talk to him. Tell him i sent you, and take this with you.')
setPlayerStorageValue(cid, 7668)
doPlayerAddItem(cid, 6096, 1)
else
selfSay('Go find Jack!')
end
end
end
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())
And sice these 2 didn't work together, i havent even started on Jack
Oh and i only compiled this using common sense, logic thinking, and other npc scripts. I am no scripter so be gentle with the flaming please =\
Last edited: