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

[Request] Absorbing Spirits Quest

juansanchez

Advanced OT User
Joined
Apr 2, 2015
Messages
223
Reaction score
154
Hey otland guys, i need some help with this quest i "came up" with.

It's pretty much the same thing as it is in the POI quest.
Straight to bussines, the player will need to find 3 specific walls around a cave and right click them. When the player right clicks the wall, he'll absorb the wall energy/spirit/power. Just like in POI, when he absorb the 3 spirits, he'll be abble to go trough the 3 specific tiles.
Could someone help me out?

I'm using TFS version 0.3.7_SVN (Crying Damson)
 
Code:
-- <action actionid="45000" event="script" value="walls_energy_spirit_power.lua"/>

function onUse(cid, item, fromPosition, itemEx, toPosition)

   if item.uid == 45001 and getPlayerStorageValue(cid, 45001) < 1 then
     setPlayerStorageValue(cid, 45001, 1)
     doCreatureSay(cid, "You have absorbed some energy", TALKTYPE_ORANGE_1, cid)
   elseif item.uid == 45002 and getPlayerStorageValue(cid, 45002) < 1 then
     setPlayerStorageValue(cid, 45002, 1)
     doCreatureSay(cid, "You have absorbed some spirit", TALKTYPE_ORANGE_1, cid)
   elseif item.uid == 45003 and getPlayerStorageValue(cid, 45003) < 1 then
     setPlayerStorageValue(cid, 45003, 1)
     doCreatureSay(cid, "You have absorbed some power", TALKTYPE_ORANGE_1, cid)
   end
  
   return true
end

-- <movevent type="StepIn" actionid="45001" event="script" value="energy.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if isPlayer(cid) == FALSE then
     return true
   end
   if getPlayerStorageValue(cid, 45001) == 1 then
     doCreatureSay(cid, "The energy courses through you.", TALKTYPE_ORANGE_1, cid)
   else
     doCreatureSay(cid, "No energy cources through you.", TALKTYPE_ORANGE_1, cid)
     doTeleportThing(cid, fromPosition, false)
   end
  
   return true
end

-- <movevent type="StepIn" actionid="45002" event="script" value="spirit.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if isPlayer(cid) == FALSE then
     return true
   end
   if getPlayerStorageValue(cid, 45002) == 1 then
     doCreatureSay(cid, "The spirit courses through you.", TALKTYPE_ORANGE_1, cid)
   else
     doCreatureSay(cid, "No spirit cources through you.", TALKTYPE_ORANGE_1, cid)
     doTeleportThing(cid, fromPosition, false)
   end
  
   return true
end

--<movevent type="StepIn" actionid="45003" event="script" value="power.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if isPlayer(cid) == FALSE then
     return true
   end
   if getPlayerStorageValue(cid, 45003) == 1 then
     doCreatureSay(cid, "The power courses through you.", TALKTYPE_ORANGE_1, cid)
   else
     doCreatureSay(cid, "No power cources through you.", TALKTYPE_ORANGE_1, cid)
     doTeleportThing(cid, fromPosition, false)
   end
  
   return true
end
 
Code:
-- <action actionid="45000" event="script" value="walls_energy_spirit_power.lua"/>

function onUse(cid, item, fromPosition, itemEx, toPosition)

   if item.uid == 45001 and getPlayerStorageValue(cid, 45001) < 1 then
     setPlayerStorageValue(cid, 45001, 1)
     doCreatureSay(cid, "You have absorbed some energy", TALKTYPE_ORANGE_1, cid)
   elseif item.uid == 45002 and getPlayerStorageValue(cid, 45002) < 1 then
     setPlayerStorageValue(cid, 45002, 1)
     doCreatureSay(cid, "You have absorbed some spirit", TALKTYPE_ORANGE_1, cid)
   elseif item.uid == 45003 and getPlayerStorageValue(cid, 45003) < 1 then
     setPlayerStorageValue(cid, 45003, 1)
     doCreatureSay(cid, "You have absorbed some power", TALKTYPE_ORANGE_1, cid)
   end
 
   return true
end

-- <movevent type="StepIn" actionid="45001" event="script" value="energy.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if isPlayer(cid) == FALSE then
     return true
   end
   if getPlayerStorageValue(cid, 45001) == 1 then
     doCreatureSay(cid, "The energy courses through you.", TALKTYPE_ORANGE_1, cid)
   else
     doCreatureSay(cid, "No energy cources through you.", TALKTYPE_ORANGE_1, cid)
     doTeleportThing(cid, fromPosition, false)
   end
 
   return true
end

-- <movevent type="StepIn" actionid="45002" event="script" value="spirit.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if isPlayer(cid) == FALSE then
     return true
   end
   if getPlayerStorageValue(cid, 45002) == 1 then
     doCreatureSay(cid, "The spirit courses through you.", TALKTYPE_ORANGE_1, cid)
   else
     doCreatureSay(cid, "No spirit cources through you.", TALKTYPE_ORANGE_1, cid)
     doTeleportThing(cid, fromPosition, false)
   end
 
   return true
end

--<movevent type="StepIn" actionid="45003" event="script" value="power.lua"/>

function onStepIn(cid, item, position, fromPosition)

   if isPlayer(cid) == FALSE then
     return true
   end
   if getPlayerStorageValue(cid, 45003) == 1 then
     doCreatureSay(cid, "The power courses through you.", TALKTYPE_ORANGE_1, cid)
   else
     doCreatureSay(cid, "No power cources through you.", TALKTYPE_ORANGE_1, cid)
     doTeleportThing(cid, fromPosition, false)
   end
 
   return true
end

Thanks @Xikini it worked flawlessly!!
 
To be honest, I'm glad you knew how to install it. :rolleyes: :oops:
I didn't want to go through the effort to explain how. :p :D

Btw check the spelling on these lines
Code:
doCreatureSay(cid, "No power cources through you.", TALKTYPE_ORANGE_1, cid)
Code:
cources -- wrong
courses -- correct

Hahaha, i know the very basics of scripting, VERY BASICS, and instaling is also easy.
Don't worry about the spelling, i changed it to Portuguese.
Thanks again :)
 
Back
Top