• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Blue Legs Quest - Including map (70%done)

krille09

Belden
Joined
Aug 15, 2007
Messages
4,892
Reaction score
55
Location
Stockholm, Sweden
hiho, i wanna request a script for blue legs quest

first of all

its like a quest to get four pieces of a broken amulet (Koshei The Deathless Quest/Spoiler - TibiaWiki - see more)

so i wanna these scripts when taking one piece you get a actionID (or storage, don't know much about lua ;p)

the broken amulet id's are:
8262
8263
8264
8265

8266 (this is the finished one - need an npc script that exchange these four pieces into this finished one (you need to pay 5000 gold)

then when using on a 'strange carving' (id: 3900 - but set actionID) when you click on this, the id 7520 switches with 7525 then if it possible to like on x: xxx y: xxx z: x that it says CLICK! in orange color ;p
or something like that, maybe on the sqm where 7520 and 7525 switches ^^

screenshot - just an example;
jj2oau.jpg


and then when reached to x: xxx y: xxx z: x sqm ( i want have 3x of these since it's 3 sqm you can step forward in^^ )then spawn the monster 'Koshei The Deathless'
and after he died, you have 10seconds to use the amulet on the body or he will spawn again until done it...

then after used the amulet on the body, you get a actionID / storage that does you can go through the quest door



thanks :)

edit:
i have done the 4 quest for the 4 pieces of the broken amulet:

report please

poba = piece of broken amulet

poba1.lua
PHP:
-- blue legs quest
-- by krille09
function onUse(cid, item, frompos, item2, topos)

   	if item.uid == 7511 then
   		queststatus = getPlayerStorageValue(cid,7611)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8262,1)
   			setPlayerStorageValue(cid,7611,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

poba2.lua
PHP:
-- blue legs quest
-- by krille09
function onUse(cid, item, frompos, item2, topos)

   	if item.uid == 7512 then
   		queststatus = getPlayerStorageValue(cid,7612)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8263,1)
   			setPlayerStorageValue(cid,7612,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

poba3.lua
PHP:
-- blue legs quest
-- by krille09
function onUse(cid, item, frompos, item2, topos)

   	if item.uid == 7513 then
   		queststatus = getPlayerStorageValue(cid,7613)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8264,1)
   			setPlayerStorageValue(cid,7613,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

poba4.lua
PHP:
-- blue legs quest
-- by krille09
function onUse(cid, item, frompos, item2, topos)


   	if item.uid ==7514 then
   		queststatus = getPlayerStorageValue(cid,7614)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8265,1)
   			setPlayerStorageValue(cid,7614,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

-- report from this npc.lua
blue_legs_quest_npc.lua
PHP:
-- based on a sweaty cyclops.lua (no credits since he didn't leave any names)
-- edited by krille09

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

    -- use the real conversation? (true/false)
    real = false
    
    if real == true then
        tradeMsg = 'I can fix all the four pieces of the broken amulet into one!'
		fourpobaMsg = 'Do you want me to fix all the four pieces of that broken amulet?'
        hasNoMsg = 'You need all four piece of the broken amulet to get all, or I can\'t fix it!'
        noMsg = 'I have no time, I\'m a busy man, LEAVE!'
    else
        tradeMsg = 'I can fix all the four pieces of the broken amulet into one!'
		fourpobaMsg = 'Do you want me to fix all the four pieces of that broken amulet?'
        hasNoMsg = 'You need all four piece of the broken amulet to get all, or I can\'t fix it!'
        noMsg = 'I have no time, I\'m a busy man, LEAVE!'
    end
        if msgcontains(msg, 'trade') or msgcontains(msg, 'fix') then
            selfSay(tradeMsg)
        elseif msgcontains(msg, 'change') or msgcontains(msg, 'piece') or msgcontains(msg, 'four') then
            selfSay(fourpobaMsg)
            talk_state = 1
------------------------------------------------ confirm yes ------------------------------------------------
        elseif msgcontains(msg, 'yes') and talk_state == 1 then
            if getPlayerItemCount(cid,8262) >= 1 then
			if getPlayerItemCount(cid,8263) >= 1 then
			if getPlayerItemCount(cid,8264) >= 1 then
			if getPlayerItemCount(cid,8265) >= 1 then
                if doPlayerTakeItem(cid,8262,1) == 0 then
				if doPlayerTakeItem(cid,8263,1) == 0 then
				if doPlayerTakeItem(cid,8264,1) == 0 then
				if doPlayerTakeItem(cid,8265,1) == 0 then
                    selfSay('Here you are.')
                    doPlayerAddItem(cid,8266,1)
                end
            else
                selfSay(hasNoMsg)
            end
            talk_state = 0

------------------------------------------------ confirm no ------------------------------------------------
        elseif msgcontains(msg, 'no') and (talk_state == 1) then
            selfSay(noMsg)
            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

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

Blue_Legs_Quest_NPC.xml
PHP:
<?xml version="1.0"?>
<npc name="Blue Legs Quest NPC" script="data/npc/scripts/blue_legs_quest_npc.lua" access="5" lookdir="2" walkinterval="3">
<health now="137" max="1337" />
<look type="133" head="67" body="61" legs="61" feet="67" />
<parameters>
<parameter key="module_shop" value="1" />
 <parameter key="message_greet" value="Greetings, |PLAYERNAME|. I can change your four items into one amulet!" />
</parameters>
</npc>


Download Link! (Including map)
 
Last edited:
Hello

this works perfect in 0.3.4 TFS


PHP:
-- base script by krille09
-- edited by nipr0nz (zniC)
 
function onUse(cid, item, frompos, item2, topos)
 
if item.uid == 7511 then
queststatus = getPlayerStorageValue(cid,7611)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
doPlayerAddItem(cid,8262,1)
setPlayerStorageValue(cid,7611,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
 
elseif item.uid == 7512 then
queststatus = getPlayerStorageValue(cid,7612)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
doPlayerAddItem(cid,8263,1)
setPlayerStorageValue(cid,7612,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
 
elseif item.uid == 7513 then
queststatus = getPlayerStorageValue(cid,7613)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
doPlayerAddItem(cid,8264,1)
setPlayerStorageValue(cid,7613,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
 
elseif item.uid == 7514 then
queststatus = getPlayerStorageValue(cid,7614)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
doPlayerAddItem(cid,8265,1)
setPlayerStorageValue(cid,7614,1)
else
doPlayerSendTextMessage(cid,22,"It is empty.")
end
end
return TRUE
end
 
Help please

[12/07/2009 14:07:03] [warning - npcscript::npcscript] cannot load script: Data/npc/scripts/blegs.lua
[12/07/2009 14:07:03] data/npc/scripts/blegs.lua:24: '=' expected near 'fix'

npc

-- based on a sweaty cyclops.lua (no credits since he didn't leave any names)
-- edited by krille09

local keywordhandler = keywordhandler:new()
local npchandler = npchandler:new(keywordhandler)
npcsystem.parseparameters(npchandler)

-- otserv event handling functions start
function oncreatureappear(cid) npchandler:eek:ncreatureappear(cid) end
function oncreaturedisappear(cid) npchandler:eek:ncreaturedisappear(cid) end
function oncreaturesay(cid, type, msg) npchandler:eek:ncreaturesay(cid, type, msg) end
function onthink() npchandler:eek:nthink() 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

-- use the real conversation? (true/false)
real = false

if real == true then
trademsg = 'i can fix all the four pieces of the broken amulet into one!'
fourpobamsg = 'do you want me to fix all the four pieces of that broken amulet?'
hasnomsg = 'you need all four piece of the broken amulet to get all, or i can't fix it!'
nomsg = 'i have no time, i\'m a busy man, leave!'
else
trademsg = 'i can fix all the four pieces of the broken amulet into one!'
fourpobamsg = 'do you want me to fix all the four pieces of that broken amulet?'
hasnomsg = 'you need all four piece of the broken amulet to get all, or i can\'t fix it!'
nomsg = 'i have no time, i\'m a busy man, leave!'
end
if msgcontains(msg, 'trade') or msgcontains(msg, 'fix') then
selfsay(trademsg)
elseif msgcontains(msg, 'change') or msgcontains(msg, 'piece') or msgcontains(msg, 'four') then
selfsay(fourpobamsg)
talk_state = 1
------------------------------------------------ confirm yes ------------------------------------------------
elseif msgcontains(msg, 'yes') and talk_state == 1 then
if getplayeritemcount(cid,8262) >= 1 then
if getplayeritemcount(cid,8263) >= 1 then
if getplayeritemcount(cid,8264) >= 1 then
if getplayeritemcount(cid,8265) >= 1 then
if doplayertakeitem(cid,8262,1) == 0 then
if doplayertakeitem(cid,8263,1) == 0 then
if doplayertakeitem(cid,8264,1) == 0 then
if doplayertakeitem(cid,8265,1) == 0 then
selfsay('here you are.')
doplayeradditem(cid,8266,1)
end
else
selfsay(hasnomsg)
end
talk_state = 0

------------------------------------------------ confirm no ------------------------------------------------
elseif msgcontains(msg, 'no') and (talk_state == 1) then
selfsay(nomsg)
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

npchandler:setcallback(callback_message_default, creaturesaycallback)
npchandler:addmodule(focusmodule:new())
 
You can only enter the QuestDoor(Reward) when you use the amulet on the corpose of Koshei.

Code:
--- Credits BinHo® ---
local creatureTxt = "At least I have it back, my precious amulet. I am glad you didn't use it! I allow you to ...ahh....enter door.... ahh"

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if itemEx.itemid == 6028 then
                if getPlayerStorageValue(cid, 36205) == -1 then
                doCreatureSay(cid, creatureTxt, 19, {x=toPosition.x, y=toPosition.y-1, z=toPosition.z})
                doRemoveItem(cid, item.uid, 1)
                setPlayerStorageValue(cid, 36205, 1)
            end
        end
end
You have 10 second to use amulet, otherwise, you must kill Koshei again.
Set StorageValue in MagicDoor (by MapEditor/RME).
For items rewards, use 0.3 Quest System, and done!

Where this script must to go????
 
You can only enter the QuestDoor(Reward) when you use the amulet on the corpose of Koshei.

Code:
--- Credits BinHo® ---
local creatureTxt = "At least I have it back, my precious amulet. I am glad you didn't use it! I allow you to ...ahh....enter door.... ahh"

function onUse(cid, item, fromPosition, itemEx, toPosition)
        if itemEx.itemid == 6028 then
                if getPlayerStorageValue(cid, 36205) == -1 then
                doCreatureSay(cid, creatureTxt, 19, {x=toPosition.x, y=toPosition.y-1, z=toPosition.z})
                doRemoveItem(cid, item.uid, 1)
                setPlayerStorageValue(cid, 36205, 1)
            end
        end
end
You have 10 second to use amulet, otherwise, you must kill Koshei again.
Set StorageValue in MagicDoor (by MapEditor/RME).
For items rewards, use 0.3 Quest System, and done!

where i put this?
 
Add in /data/actions/actions.xml:
Code:
	<action itemid="8266" event="script" value="ancientamulet.lua"/>
Create file /data/actions/scripts/ancientamulet.lua with contents:
Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if itemEx.itemid == 6028 and getPlayerStorageValue(cid, 36205) == -1 then
		doCreatureSay(cid, "At least I have it back, my precious amulet. I am glad you didn't use it! I allow you to ...ahh....enter door.... ahh", TALKTYPE_ORANGE_1, false, 0, toPosition)
		doRemoveItem(item.uid)
		setPlayerStorageValue(cid, 36205, 1)
		return true
	end
end
 
Back
Top