• 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!

Action Blue Legs Quest 0.2.~

Erikas Kontenis

Board Moderator
Staff member
Board Moderator
Joined
Jul 3, 2009
Messages
1,864
Reaction score
567
Location
Lithuania
Hello :) Im Releasing Self Made Blue Legs Quest :) Powered Real Tibia.

So Lets Start.

Actions:

Lua:
<!-- Blue Legs Quest -->
	<action uniqueid="7511" script="blue legs/reward.lua" />
	<action uniqueid="7512" script="blue legs/reward.lua" />
	<action uniqueid="7517" script="blue legs/reward.lua" />
	<action uniqueid="7516" script="blue legs/reward.lua" />
	<action uniqueid="7513" script="blue legs/reward.lua" />
	<action uniqueid="7514" script="blue legs/reward.lua" />
	<action itemid="8266" script="blue legs/kosheiamulet.lua"/>
	<action uniqueid="5787" script="doors/blue door.lua" />

Reward.lua

Lua:
-- Blue Legs Scripted By Apsivaflines

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

   	if item.uid == 7511 then
   		queststatus = getPlayerStorageValue(cid,5112)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8262,1)
   			setPlayerStorageValue(cid,5112,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7512 then
   		queststatus = getPlayerStorageValue(cid,5212)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8263,1)
   			setPlayerStorageValue(cid,5212,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
         elseif item.uid == 7517 then
   		queststatus = getPlayerStorageValue(cid,5312)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found 50 Platinum Coints.")
   			doPlayerAddItem(cid,2152,50)
   			setPlayerStorageValue(cid,5312,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
         elseif item.uid == 7516 then
   		queststatus = getPlayerStorageValue(cid,5412)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Blue Legs.")
   			doPlayerAddItem(cid,7730,1)
   			setPlayerStorageValue(cid,5412,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7513 then
   		queststatus = getPlayerStorageValue(cid,5512)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8264,1)
   			setPlayerStorageValue(cid,5512,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7514 then
   		queststatus = getPlayerStorageValue(cid,5612)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8265,1)
   			setPlayerStorageValue(cid,5612,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return 0
   	end

   	return 1
end

kosheiamulet.lua

Lua:
-- Blue Legs Scripted By Apsivaflines

  function onUse(cid, item, fromPosition, itemEx, toPosition)
        if itemEx.itemid == 3025 then
        if item.itemid == 8266 then
                getPlayerStorageValue(cid, 36205)
                doSendAnimatedText(getPlayerPosition(cid), "At least!", TEXTCOLOR_RED)
                setPlayerStorageValue(cid, 36205,1)
                doRemoveItem(cid, item.uid, 1)
            end
        end
end

Blue Door.lua
Lua:
-- Blue Legs Scripted By Apsivaflines

function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == 5787 then
		if(isInArray({getPlayerStorageValue(cid, 5112), getPlayerStorageValue(cid, 5212), getPlayerStorageValue(cid, 36205), getPlayerStorageValue(cid, 5612), getPlayerStorageValue(cid, 5512), getPlayerStorageValue(cid, 36205)}, -1) == 1) then
  			doPlayerSendTextMessage(cid, 22, "Fuck Off Gay!")
		else
			doPlayerSendTextMessage(cid, 22, "You may pass.")
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, 1)
		end
		return 1
	end
	return 0
end


Monsters:

Lua:
<monster name="Koshei The Deathless" file="8.4 Monsters/Koshei The Deathless.xml"/>

Xml:

Lua:
<?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>

Npc:

quest of blue legs.xml

Lua:
<npc name="Quest Of Blue Legs" script="data/npc/scripts/bluelegs.lua" floorchange="0" access="5" level="1" maglevel="1">
	<health now="150" max="150"/>
	<look type="128" head="20" body="100" legs="50" feet="99" corpse="2212"/>
	<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>

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())

Thanks All... I Hope Us Like It And Wont Forget Rep me ;)

Tested On 0.2.4-0.2.5 100% Works Without Any Errors
 
Lua:
return 1 = return true [Use It]
return 0 = return false [Use It]
 
Lua:
return 1 = return true [Use It]
return 0 = return false [Use It]


Hm... why? can i ask this one? Why Return true and not return 1? for me is more better write return 1 becouse like 0.2.5 Scripts :)

i know in 0.3.5 Tfs example it will by return true and return 1 Wont Work. so mayby u can explain for me why return ture and return false ?
 
Hm... why? can i ask this one? Why Return true and not return 1? for me is more better write return 1 becouse like 0.2.5 Scripts :)

i know in 0.3.5 Tfs example it will by return true and return 1 Wont Work. so mayby u can explain for me why return ture and return false ?
Use return TRUE/FALSE for backward compatibility.

in TFS 0.2's global.lua,
Code:
TRUE = 1
FALSE = 0

in 0.3's const.lua:
Code:
TRUE = true
FALSE = false
 
You rep him for that... :huh:
btw, yea you should start using true/false instead of 1/0.
 
Reward.lua

Lua:
-- Blue Legs Quest Chests -- Scripted By Apsivaflines

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

   	if item.uid == 7511 then
   		queststatus = getPlayerStorageValue(cid,1010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8262,1)
   			setPlayerStorageValue(cid,1010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7512 then
   		queststatus = getPlayerStorageValue(cid,2010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found one piece of the broken amulet.")
   			doPlayerAddItem(cid,8263,1)
   			setPlayerStorageValue(cid,2010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7513 then
   		queststatus = getPlayerStorageValue(cid,3010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have one piece of the broken amulet.")
   			doPlayerAddItem(cid,8264,1)
   			setPlayerStorageValue(cid,3010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
   	elseif item.uid == 7514 then
   		queststatus = getPlayerStorageValue(cid,4010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have one piece of the broken amulet.")
   			doPlayerAddItem(cid,8265,1)
   			setPlayerStorageValue(cid,4010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
		elseif item.uid == 7516 then
   		queststatus = getPlayerStorageValue(cid,6010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found Blue Legs.")
   			doPlayerAddItem(cid,7730,1)
   			setPlayerStorageValue(cid,6010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
		elseif item.uid == 7517 then
   		queststatus = getPlayerStorageValue(cid,6010)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,22,"You have found 50 Platinum Coints.")
   			doPlayerAddItem(cid,2152,50)
   			setPlayerStorageValue(cid,6010,1)
   		else
   			doPlayerSendTextMessage(cid,22,"It is empty.")
   		end
	else
		return false
   	end

   	return true
end

kosheiamulet.lua

Lua:
  function onUse(cid, item, fromPosition, itemEx, toPosition)
        if itemEx.itemid == 3025 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

Door.lua

Lua:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	if item.uid == 5787 then
		if(isInArray({getPlayerStorageValue(cid, 36205), getPlayerStorageValue(cid, 36205), getPlayerStorageValue(cid, 36205), getPlayerStorageValue(cid, 36205), getPlayerStorageValue(cid, 36205), getPlayerStorageValue(cid, 36205)}, -1) == TRUE) then
  			doPlayerSendTextMessage(cid, 22, "The door seems to be sealed against unwanted intruders.")
		else
			doPlayerSendTextMessage(cid, 22, "You may pass.")
			doTransformItem(item.uid, item.itemid + 1)
			doTeleportThing(cid, toPosition, TRUE)
		end
		return TRUE
	end
	return FALSE
end

Not Tested Xex :p But it most works :D And feel free to rep me :D
 
Yea, he thinks just changing return 1, to return true will fix it. 0.3.5 :p
 
So all I gotta do is to replace the current script with this? And i'ts going to work:)? Nothing in RME or such~
 
So all I gotta do is to replace the current script with this? And i'ts going to work:)? Nothing in RME or such~


Koshei The Deathless Quest/Spoiler - TibiaWiki - Quests, Items, Spells, and more

Put in right place's or if you got custom map so put what ever you wanna unique id... and do not forgot action.xml :D

Lua:
 <action uniqueid="7511" script="blue legs/reward.lua" />
 <action uniqueid="7512" script="blue legs/reward.lua" />
 <action uniqueid="7513" script="blue legs/reward.lua" />
 <action uniqueid="7514" script="blue legs/reward.lua" /> 
 <action uniqueid="7516" script="blue legs/reward.lua" />
 <action uniqueid="7517" script="blue legs/reward.lua" /> 	
 <action itemid="8266" script="blue legs/kosheiamulet.lua"/>
 <action uniqueid="5787" script="blue legs/door.lua"/>
 
Koshei The Deathless Quest/Spoiler - TibiaWiki - Quests, Items, Spells, and more

Put in right place's or if you got custom map so put what ever you wanna unique id... and do not forgot action.xml :D

Lua:
 <action uniqueid="7511" script="blue legs/reward.lua" />
 <action uniqueid="7512" script="blue legs/reward.lua" />
 <action uniqueid="7513" script="blue legs/reward.lua" />
 <action uniqueid="7514" script="blue legs/reward.lua" /> 
 <action uniqueid="7516" script="blue legs/reward.lua" />
 <action uniqueid="7517" script="blue legs/reward.lua" /> 	
 <action itemid="8266" script="blue legs/kosheiamulet.lua"/>
 <action uniqueid="5787" script="blue legs/door.lua"/>
That wouldn't work in 0.3.5 ^_^
But well, you stated yourself that the script is for 0.2
 

Similar threads

Back
Top