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

Lua Movements Problem

Tovar

Brak V
Joined
Jul 26, 2008
Messages
347
Reaction score
8
Well, as title says, I'm trying to fix my firewalker boots quest, the unique problem that I have "After kill Pythius the tp doesn't appear." there are my movements scripts about it.

I checked all the forum searching something like that script, but they have many bugs, the mine "I think" is the most clear, only by one exception and is my problem.


PythiusTheRotten_Enterance.lua

Code:
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
				if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

local once = true
local tiles = {{x=32550,y=31373,z=15}, {x=32550,y=31374,z=15}, {x=32550,y=31375,z=15}, {x=32550,y=31376,z=15}, {x=32550,y=31377,z=15}, {x=32550,y=31378,z=15}, {x=32550,y=31379,z=15}, {x=32551,y=31373,z=15}, {x=32551,y=31374,z=15}, {x=32551,y=31375,z=15}, {x=32551,y=31376,z=15}, {x=32551,y=31377,z=15}, {x=32551,y=31378,z=15}, {x=32551,y=31379,z=15}}

function onStepIn(cid, item, position, fromPosition)
	if 99 < getPlayerLevel(cid) then
		if(getPlayerStorageValue(cid, 13101) < 1 and once or not once) then
			local players = getCreaturesInRange({x=32566, y=31406, z=15}, 6, 7, FALSE, TRUE)
			if #players == 0 then
				local creatures = getCreaturesInRange({x=32566, y=31406, z=15}, 6, 7, TRUE, FALSE)
				for i = 1, #creatures do
					doRemoveCreature(creatures[i])
				end
				doRemoveItem(item.uid)
				doSendMagicEffect(position, CONST_ME_TELEPORT)
				doTeleportThing(cid, {x=32560, y=31404,z=15})
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
				doCreatureSay(doSummonCreature("Pythius the Rotten", {x=32572, y=31405, z=15}), "WHO IS SNEAKING AROUND BEHIND MY TREASURE?", TALKTYPE_ORANGE_2)
				for i = 1, #tiles do
					if i > 8 and i < 15 then
						doRelocate(tiles[i], {x=tiles[i].x+1, y=i == 14 and tiles[i].y-1 or tiles[i].y, z=tiles[i].z})
					end
					doCreateItem(i == 14 and 1509 or 598, 1, tiles[i])
				end
				doCreateItem(1304, 1, {x=32551,y=31379,z=15})
				doCreateItem(9341, 1, {x=32551,y=31379,z=15})
				return TRUE
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "There is someone else in the quest room.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already completed this quest.")
		end
	end
	doTeleportThing(cid, {x=32553, y=31376, z=15})
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	return TRUE
end

function onAddItem(moveitem, tileitem, pos)
	doSendMagicEffect(pos, CONST_ME_TELEPORT)
	doRelocate(pos, {x=32560, y=31404,z=15})
	doSendMagicEffect({x=32560, y=31404,z=15}, CONST_ME_TELEPORT)
	return TRUE
end


PythiusTheRotten_Exit.lua

Code:
function onStepIn(cid, item, position, fromPosition)
	doTeleportThing(cid, {x=922, y=1258, z=15}, FALSE)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	local creatures = getCreaturesInRange({x=936, y=1287, z=15}, 6, 7, TRUE, FALSE)
	for i = 1, #creatures do
		doRemoveCreature(creatures[i])
	end
	return TRUE
end

function onAddItem(moveitem, tileitem, pos)
	doSendMagicEffect(pos, CONST_ME_TELEPORT)
	doRelocate(pos, {x=922, y=1258,z=15})
	doSendMagicEffect({x=922, y=1258,z=15}, CONST_ME_TELEPORT)
	return TRUE
end

pythius.lua

Code:
function onStepIn(cid, item, pos)

local tam = {x=32578, y=31405, z=15}

    if item.actionid == 14061 then
		doTeleportThing(cid,tam)
        doSendMagicEffect(getCreaturePosition(cid),17)
        end
    return 1
end

pythius1.lua

Code:
function onAddItem(moveitem, tileitem, position)
	if tileitem.itemid == 7655 then
		doRemoveItem(moveitem.uid,1)
		doTransformItem(tileitem.uid,tileitem.itemid+10)
		doSendMagicEffect(position,CONST_ME_MAGIC_BLUE)
	end
	return 1
end

movements.xml

Code:
 	<!-- PYthius -->
  	<movevent type="AddItem" tileitem="1" actionid="60126" event="script" value="PythiusTheRotten/PythiusTheRotten_Enterance.lua"/>
   	<movevent type="StepIn" actionid="60126" event="script" value="PythiusTheRotten/PythiusTheRotten_Enterance.lua"/>
 	<movevent type="AddItem" tileitem="1" uniqueid="60127" event="script" value="PythiusTheRotten/PythiusTheRotten_Exit.lua"/>
   	<movevent type="StepIn" uniqueid="60127" event="script" value="PythiusTheRotten/PythiusTheRotten_Exit.lua"/>
	<movevent type="StepIn" actionid="14061" event="script" value="pythius.lua" />

In the part of movements.xml there is just missing pythius1.lua it can be the problem?

I'll be grateful.
 
Well is not error at all, I just want after kill pythius tp appears. With it I can do much, I use the pick on the stone (I got other script about it), and tp to enter in pythius area appears, then when enter in tp2, pythius appear and send the message in orange, but when you kill it, the tp to do the quest doesn't appear.
 
cus you are doing it wrong, the scripts just will check if there is someone in the area, wait me a few
if found this on my pc so credits to IDK
Lua:
function onDeath(cid, corpse, deathList)
	if getCreatureName(cid):lower() == "pythius the rotten" then
		for i = 1, #deathList do
			if isPlayer(deathList[i]) then
				doCreatureSay(deathList[i], "NICE FIGHTING LITTLE WORM, YOUR VICTORY SHALL BE REWARDED!", TALKTYPE_ORANGE_1, nil, nil, {x=32577, y=31402, z=15})
				doSendMagicEffect(getCreaturePosition(deathList[i]), CONST_ME_TELEPORT)
				doTeleportThing(deathList[i], {x=32577, y=31402, z=15})
				doSendMagicEffect({x=32577, y=31402, z=15}, CONST_ME_TELEPORT)
				break
			end
		end
	end
	return true
end

XML:
<event type="death" name="PythiusTheRotten" event="script" value="PythiusTheRotten.lua"/>

and register it
Lua:
registerCreatureEvent(cid, "PythiusTheRotten")

also add this to your boss xml
XML:
<script>
	<event name="PythiusTheRotten"/>
  </script>

or use this
XML:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Pythius The Rotten" nameDescription="Pythius the rotten" race="undead" experience="7000" speed="300" manacost="0">
  <health now="9000" max="9000"/>
  <look type="231" corpse="0"/>
  <targetchange interval="60000" chance="0"/>
  <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>
   <script>
	<event name="PythiusTheRotten"/>
  </script>
  <attacks>
    <attack name="melee" interval="2000" min="0" max="-400"/>
    <attack name="lifedrain" interval="2000" chance="14" range="7" radius="4" target="1" min="-165" max="-200">
      <attribute key="shootEffect" value="fire"/>
      <attribute key="areaEffect" value="redspark"/>
    </attack>
    <attack name="physical" interval="2500" chance="13" range="7" min="-0" max="-200">
      <attribute key="shootEffect" value="suddendeath"/>
      <attribute key="areaEffect" value="mortarea"/>
    </attack>
    <attack name="earth" interval="2000" chance="14" range="7" radius="4" target="1" min="-55" max="-155">
      <attribute key="shootEffect" value="poison"/>
      <attribute key="areaEffect" value="poison"/>
    </attack>
    <attack name="earth" interval="2000" chance="9" length="8" min="-333" max="-418">
      <attribute key="areaEffect" value="poison"/>
    </attack>
    <attack name="manadrain" interval="2000" chance="15" radius="4" target="1" min="-85" max="-110">
      <attribute key="shootEffect" value="energy"/>
      <attribute key="areaEffect" value="energy"/>
    </attack>
    <attack name="speed" interval="2000" chance="10" range="7" target="1" speedchange="-650">
      <attribute key="shootEffect" value="ice"/>
      <attribute key="areaEffect" value="iceattack"/>
    </attack>
    <attack name="pythius curse" interval="2000" chance="5" range="4" target="1"/>
    <attack name="pythius summon" interval="5000" chance="16" target="0"/>
  </attacks>
  <defenses armor="40" defense="45">
  </defenses>
  
  <immunities>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
    <immunity lifedrain="1"/>
    <immunity death="1"/>
    <immunity energy="1"/>
    <immunity earth="1"/>
  </immunities>
  <voices interval="5000" chance="10">
    <voice sentence="YOU'LL NEVER GET MY TREASURE!" yell="1"/>
	<voice sentence="MINIONS, MEET YOUR NEW BROTHER!" yell="1"/>
	<voice sentence="YOU WILL REGRET THAT YOU ARE BORN!" yell="1"/>
	<voice sentence="YOU MADE A HUGE WASTE!" yell="1"/>
  </voices>
</monster>
 
Last edited:
Nothing, I think the problem is here

Code:
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				local creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z})
				if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end

	local creature = getTopCreature(position)
	if (creature.type == 1 and showPlayers) or (creature.type == 2 and showMonsters and (not showSummons or (showSummons and getCreatureMaster(creature.uid) == (creature.uid)))) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end

local once = true
local tiles = {{x=32550,y=31373,z=15}, {x=32550,y=31374,z=15}, {x=32550,y=31375,z=15}, {x=32550,y=31376,z=15}, {x=32550,y=31377,z=15}, {x=32550,y=31378,z=15}, {x=32550,y=31379,z=15}, {x=32551,y=31373,z=15}, {x=32551,y=31374,z=15}, {x=32551,y=31375,z=15}, {x=32551,y=31376,z=15}, {x=32551,y=31377,z=15}, {x=32551,y=31378,z=15}, {x=32551,y=31379,z=15}}

function onStepIn(cid, item, position, fromPosition)
	if 99 < getPlayerLevel(cid) then
		if(getPlayerStorageValue(cid, 13101) < 1 and once or not once) then
			local players = getCreaturesInRange({x=32566, y=31406, z=15}, 6, 7, FALSE, TRUE)
			if #players == 0 then
				local creatures = getCreaturesInRange({x=32566, y=31406, z=15}, 6, 7, TRUE, FALSE)
				for i = 1, #creatures do
					doRemoveCreature(creatures[i])
				end
				doRemoveItem(item.uid)
				doSendMagicEffect(position, CONST_ME_TELEPORT)
				doTeleportThing(cid, {x=32560, y=31404,z=15})
				doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
				doCreatureSay(doSummonCreature("Pythius the Rotten", {x=32572, y=31405, z=15}), "WHO IS SNEAKING AROUND BEHIND MY TREASURE?", TALKTYPE_ORANGE_2)
				for i = 1, #tiles do
					if i > 8 and i < 15 then
						doRelocate(tiles[i], {x=tiles[i].x+1, y=i == 14 and tiles[i].y-1 or tiles[i].y, z=tiles[i].z})
					end
					doCreateItem(i == 14 and 1509 or 598, 1, tiles[i])
				end
				doCreateItem(1304, 1, {x=32551,y=31379,z=15})
				doCreateItem(9341, 1, {x=32551,y=31379,z=15})
				return TRUE
			else
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "There is someone else in the quest room.")
			end
		else
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already completed this quest.")
		end
	end
	doTeleportThing(cid, {x=32553, y=31376, z=15})
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	return TRUE
end

function onAddItem(moveitem, tileitem, pos)
	doSendMagicEffect(pos, CONST_ME_TELEPORT)
	doRelocate(pos, {x=32560, y=31404,z=15})
	doSendMagicEffect({x=32560, y=31404,z=15}, CONST_ME_TELEPORT)
	return TRUE
end

because when pythius appear it say this "WHO IS SNEAKING AROUND BEHIND MY TREASURE?" He didn't say the words of script you posted.
 
It don't work, trust me, I've put it good, and nothing... I think the problem is in pythius_entrance.lua ........ any one understand me? or can help?
 
Back
Top