Action Blue Legs Qust tfs 0.3.5

Joined
Jun 24, 2009
Messages
103
Best answers
0
Reaction score
0
Location
Sweden
Hello didnt see any working npc for blue legs quest on tfs 0.3.5pl
here it is ;)

actions/scripts/Poba1.lua
Lua:
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
actions/scripts/Poba2.lua
Lua:
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

actions/scripts/Poba3.lua

Lua:
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
and last actions/scripts/Poba4.lua

Lua:
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
and add in npc folder
Quest of blue legs.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Quest of blue legs" script="bluelegs.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
    <parameters>
	     <parameter key="message_greet" value="Hello |PLAYERNAME|. Hello did do you bring the 4 piece's of broken amulets with you?. Say {piece of broken amulet} and i can help you."" />
    </parameters>
</npc>

and in npcs/scripts/bluelegs.lua

Lua:
  local keywordHandler = KeywordHandler: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 tokenid = 8265
        local storage = 6555
        local getstorage = getPlayerStorageValue(cid, storage)
        local sorrymessage = "Sorry, are you sure you got all 4 piece's  of broken amulets?."
        local talkUser = NPCHANDLER_CONVBEHAVIOR == CONVERSATION_DEFAULT and 0 or cid
        if msgcontains(msg, 'piece of broken amulet') then
                if getstorage == 1 then
                        npcHandler:say("You are now finished.", cid)
                elseif getstorage < 1 then
                        npcHandler:say("Would ye' like to give me 4 piece's of broken amulets.?", cid)
                        talkState[talkUser] = 1
                end
        elseif msgcontains(msg, 'Remove This shit if you want!') then
                if getstorage < 1 then
                        npcHandler:say("You have not give me 4 pice's of broken amulets.", cid)
                elseif getstorage == 1 then
                        npcHandler:say("I have aledry give you {koshei's ancient amulet} !!.", cid)
                end
        elseif msgcontains(msg, 'yes') then
                if talkState[talkUser] == 1 then
                        if getstorage < 0 then
                                if doPlayerRemoveItem(cid, tokenid, 1) == TRUE then
                                        npcHandler:say("Ye' brought the 4 piece's of broken amulets. needed to complete blue legs quest'.", cid)
                                        setPlayerStorageValue(cid, storage, 1)
										doPlayerAddItem(cid, 8266, 1)
										doPlayerRemoveItem(cid, 8264, 1)
										doPlayerRemoveItem(cid, 8263, 1)
										doPlayerRemoveItem(cid, 8262, 1)
                                        talkState[talkUser] = 0
                                elseif doPlayerRemoveItem(cid, tokenid, 1) == FALSE then
                                        npcHandler:say(sorrymessage, cid)
                                        talkState[talkUser] = 0
                                end
                        end
                end
        elseif(msgcontains(msg, 'no') and talkState[talkUser] == 1) then
                npcHandler:say("Sure, come back when you have 4 piece's of broken amulets..", cid)
                talkState[talkUser] = 0
        end
return TRUE
end
npcHandler:setCallback(CALLBACK_MESSAGE_DEFAULT, creatureSayCallback)
npcHandler:addModule(FocusModule:new())

and here is the monster file!

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Koshei The Deathless" nameDescription="a koshei the deathless" race="UNDEAD" experience="0" speed="390" manacost="0">
  <health now="2000" max="2000"/>
  <look type="99" head="95" body="116" legs="119" feet="115" corpse="6028"/>
  <targetchange interval="5000" chance="8"/>
  <strategy attack="100" defense="0"/>
  <flags>
    <flag summonable="0"/>
    <flag attackable="1"/>
    <flag hostile="1"/>
    <flag illusionable="0"/>
    <flag convinceable="0"/>
    <flag pushable="0"/>
    <flag canpushitems="1"/>
    <flag canpushcreatures="1"/>
    <flag targetdistance="1"/>
    <flag staticattack="90"/>
    <flag runonhealth="0"/>
  </flags>
  <attacks>
    <attack name="melee" interval="2000" min="-90" max="-190"/>
    <attack name="lifedrain" interval="3000" chance="9" range="1" min="-60" max="-250">
      <attribute key="areaEffect" value="blueshimmer"/>
    </attack>
    <attack name="cursecondition" interval="3000" chance="15" range="1" min="-54" max="-54"/>
    <attack name="speed" interval="2000" chance="15" range="7" speedchange="-900" duration="30000">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
    <attack name="lifedrain" interval="1000" chance="11" radius="3" target="0" min="-120" max="-200">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
    <attack name="lifedrain" interval="2000" chance="9" length="8" spread="0" min="-150" max="-295">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
    <attack name="poisoncondition" interval="3000" chance="9" length="8" spread="0" min="-300" max="-400">
      <attribute key="areaEffect" value="greenspark"/>
    </attack>
    <attack name="lifedrain" interval="3000" chance="9" range="7" radius="3" target="0" min="-90" max="-210">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
  </attacks>
  <defenses armor="20" defense="20">
    <defense name="healing" interval="1000" chance="17" min="90" max="150">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
  </defenses>
  <elements>
  <element energyPercent="80"/>
  <element holyPercent="-15"/>
  <element firePercent="-10"/>
  </elements>
  <immunities>
    <immunity death="1"/>
    <immunity earth="1"/>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons maxSummons="1">
    <summon name="bone beast" interval="1000" chance="16" max="1"/>
  </summons>
  <voices interval="5000" chance="10">
    <voice sentence="Your pain will be beyond imagination!"/>
    <voice sentence="You can't defeat me! I will ressurect and take your soul!"/>
    <voice sentence="Death is my ally!"/>
    <voice sentence="Welcome to my domain, visitor!"/>
    <voice sentence="You will be my toy on the other side!"/>
    <voice sentence="What a disgusting smell of life!"/>
  </voices>
  <loot>
  </loot>
</monster>

add in data/actions/scripts/blue legs
make file named reward1.lua

Lua:
function onUse(cid, item, frompos, item2, topos)


if item.uid ==7516 then
queststatus = getPlayerStorageValue(cid,7616)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found Blue Legs.")
doPlayerAddItem(cid,7730,1)
setPlayerStorageValue(cid,7616,1)
else
doPlayerSendTextMessage(cid,22,"You aledry done this quest.")
end
else
return 0
end

return 1
end

data/actions/scripts/blue legs
creafile reward2.lua

Lua:
function onUse(cid, item, frompos, item2, topos)


if item.uid ==7517 then
queststatus = getPlayerStorageValue(cid,7617)
if queststatus == -1 then
doPlayerSendTextMessage(cid,22,"You have found 50 Platinum Coints.")
doPlayerAddItem(cid,2152,50)
setPlayerStorageValue(cid,7617,1)
else
doPlayerSendTextMessage(cid,22,"You aledry done this quest.")
end
else
return 0
end

return 1
end

add in data/actions/scripts/blue legs
Createfile Named kosheiamulet.lua

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
        if itemEx.itemid == 6028 then
                if 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', 19, {x=toPosition.x, y=toPosition.y-1, z=toPosition.z})
                doRemoveItem(cid, item.uid, 1)
                setPlayerStorageValue(cid, 36205, 1)
            end
        end
end


add in data/actions/actions.xml

Code:
		<!-- Blue Legs Quest -->
    <action uniqueid="7511" script="blue legs/poba1.lua" />
    <action uniqueid="7512" script="blue legs/poba2.lua" />
    <action uniqueid="7513" script="blue legs/poba3.lua" />
    <action uniqueid="7514" script="blue legs/poba4.lua" /> 
	<action uniqueid="7516" script="blue legs/reward1.lua" />
    <action uniqueid="7517" script="blue legs/reward2.lua" /> 	
	<action itemid="8266" script="blue legs/kosheiamulet.lua"/>


if you like it.. dont mind rep++ me xDD


If you got anny errors with this (wich should be possible with 0.3.5pl ) contact me private

TESTED AND WORKS!
 
Last edited:

Jixxufi

tibia.at player
Joined
Jun 27, 2008
Messages
199
Best answers
0
Reaction score
0
Location
Poland
Hey, what I need to change but it's not works with 0.3.4 pl2?
 
Last edited:

Nefs

Nefs Staff
Joined
Jul 15, 2009
Messages
521
Best answers
0
Reaction score
7
Location
Barcelona (Spain)
i cannot import the npc to the remere's, say to me cannot load, format valid?
 

Tovar

Brak V
Joined
Jul 26, 2008
Messages
347
Best answers
0
Reaction score
7
hey the boss dont appear when I step on the tiles, someone can help me?.

there is my script

Code:
function onStepIn(cid, item, position, fromPosition)
 
Scheck = getPlayerStorageValue(cid, 83234)
ItemCheck = getPlayerItemById(cid,8266)
out =  {x=position.x, y=position.y-1, z=position.z}
Spawn =  {x=position.x, y=position.y-10, z=position.z}
 
--Check Begin
 
--Area Check
starting={x=33264, y=32402, z=12, stackpos=253} --Top left corner
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending=  {x=33278, y=32417, z=12, stackpos=253} --Bottom right corner
--Area Check
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
if creature.itemid > 0 then
if isPlayer(creature.uid) == 1 then
players=players+1
end
if isCreature(creature.uid) then
totalmonsters=totalmonsters+1
monster[totalmonsters]=creature.uid
   end
end
checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
--Check Ending
 
if players == 0 and totalmonsters == 0 and ItemCheck > 0 then
	doSummonCreature("Koshei The Deathless", Spawn)
 
 
elseif players==0 then
 
current=0
repeat
current=current+1
doRemoveCreature(monster[current])
until current>=totalmonsters
end
end
 

Tovar

Brak V
Joined
Jul 26, 2008
Messages
347
Best answers
0
Reaction score
7
all the scripts are good, i tested, and added manually to RME. the only problem is that the script is built to acept just 1 people per time, if another player try to enter to the room, the player and the boss will get kick from server xD.
 

Jixxufi

tibia.at player
Joined
Jun 27, 2008
Messages
199
Best answers
0
Reaction score
0
Location
Poland
bump help me :p what i need to do to work with 0.3.4.pl2
 

Jixxufi

tibia.at player
Joined
Jun 27, 2008
Messages
199
Best answers
0
Reaction score
0
Location
Poland
bump, plz tell me ? what i need to change to 0.3.4 pl2?
 

The Flash

New Member
Joined
Oct 8, 2009
Messages
78
Best answers
0
Reaction score
0
Location
The Netherlands
Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="Blue legs Quest" script="data/npc/scripts/blue legs.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="133" head="20" body="39" legs="45" feet="7" addons="0"/>
	<parameters>
	<parameter key="message_greet" value="What do you want from me, |PLAYERNAME|?" />
	     <parameter key="message_greet" value="Hello |PLAYERNAME|. Hello did do you bring the 4 piece's of broken amulets with you?. Say {piece of broken amulet} and i can help you." />
	</parameters>
</npc>
Fixed NPC, wasn't really hard lol.
 

HeberPcL

[PowerOT.com.br]
Joined
Aug 21, 2007
Messages
1,280
Best answers
0
Reaction score
38
Location
Brazil
Hello didnt see any working npc for blue legs quest on tfs 0.3.5pl
here it is ;)

actions/scripts/Poba1.lua
Lua:
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
actions/scripts/Poba2.lua
Lua:
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

actions/scripts/Poba3.lua

Lua:
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
and last actions/scripts/Poba4.lua

Lua:
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
Change To:
PHP:
-- // Script by _PcL_
-- // HeberPcL @ OTLand.net

local config = {
	level = 40, -- Level Need
	[7511] = { storage = 7611, item = 8262 }, -- uniqueID /  storage  .. item
	[7512] = { storage = 7612, item = 8263 },
	[7513] = { storage = 7613, item = 8264 },
	[7514] = { storage = 7614, item = 8265 },
}
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if getPlayerLevel(cid) < config.level then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_BLUE, "You must be atleast level ".. config.level ..".")
		return TRUE
	end	
	
	if getPlayerStorageValue(cid, config[item.uid].storage) == -1 then
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE,"You have found one ".. getItemNameById(config[item.uid].item) ..".")
		doPlayerAddItem(cid, config[item.uid].item, 1)
        doSendAnimatedText(getCreaturePosition(cid), "Success!", TEXTCOLOR_RED)
		setPlayerStorageValue(cid, config[item.uid].storage, 1)
	else
		doSendAnimatedText(fromPosition, "Empty", TEXTCOLOR_WHITE)
	end
		
	return TRUE
end
 
Top