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

Problem with Pythius Teleport

Gzuz

New Member
Joined
Jul 2, 2009
Messages
12
Reaction score
0
hi. im a newbie and tried to create Pythius the Rotten script so when you kill it will create a teleport to the reward room.

I just copied the Koshei The Deathless Script and modified it.


here is the script

function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "pythiusTeleport")

local creaturename = getCreatureName(cid)
local pythius_in_position = {x=329, y=841, z=15, stackpos=2}
local pythius_to_position = {x=342, y=839, z=15, stackpos=1}

local time_to_pass = 200
local tpID = 5023
local doEffect = CONST_ME_ENERGYHIT
local message = "GOOO! You have only less than 1 minute to enter the teleport!"

if creaturename == 'Pythius The Rotten' then

teleport = doCreateTeleport(tpID, pythius_to_position, pythius_in_position)
doSendMagicEffect(pythius_in_position, CONST_ME_ENERGYHIT)
doCreatureSay(cid,message,TALKTYPE_ORANGE_1)
addEvent(removeTeleportInpythiusWard, (1000*time_to_pass))
end
end

function removeTeleportInpythiusWard()
if getThingfromPos({x=329, y=841, z=15, stackpos=1}).itemid == 5023 then
doRemoveItem(getThingfromPos({x=329, y=841, z=15, stackpos=1}).uid,1)
doSendMagicEffect({x=329, y=841, z=15, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end

It doest say anything in the console... but in the practice... When you kill the monster it just dissapear and doesnt show the words nor the Teleport.
Yes. It is Registered with the same name in the creature file, and creature script.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="6306"/>
<targetchange interval="5000" chance="8"/>
<strategy attack="100" defense="0"/>
<flags>
<flag summonable="0"/>
<flag attackable="1"/>
<flag hostile="1"/>
<flag illusionable="1"/>
<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" skill="95" attack="95"/>
<attack name="fire" interval="2000" chance="20" range="7" radius="4" target="1" min="-300" max="-395">
<attribute key="shootEffect" value="fire"/>
<attribute key="areaEffect" value="redspark"/>
</attack>
<attack name="cursecondition" interval="3000" chance="15" range="1" min="-2000" max="-2700"/>
<attribute key="shootEffect" value="suddendeath"/>
<attack name="poison" interval="2000" chance="20" range="7" radius="4" target="1" min="-120" max="-390">
<attribute key="shootEffect" value="poison"/>
<attribute key="areaEffect" value="poison"/>
</attack>
<attack name="poison" interval="1000" chance="10" range="7" min="-50" max="-180">
<attribute key="shootEffect" value="poison"/>
<attribute key="areaEffect" value="poison"/>
</attack>
<attack name="fire" interval="4000" chance="25" length="8" spread="3" min="-500" max="-600">
<attribute key="areaEffect" value="firearea"/>
</attack>
<attack name="poison" interval="2000" chance="23" length="8" spread="3" min="-200" max="-685">
<attribute key="areaEffect" value="poison"/>
</attack>
<attack name="lifedrain" interval="3000" chance="25" length="8" spread="3" min="-300" max="-600">
<attribute key="areaEffect" value="greenshimmer"/>
</attack>
</attacks>
<defenses armor="35" defense="30">
</defenses>
<elements>
<element physicalPercent="10"/>
<element icePercent="10"/>
<element holyPercent="-10"/>
</elements>
<immunities>
<immunity death="1"/>
<immunity earth="1"/>
<immunity fire="0"/>
<immunity drown="1"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<script>
<event name="pythiusTeleport"/>
</script>
<summons maxSummons="2">
<summon name="Undead Gladiator" interval="1000" chance="8"/>
</summons>
<voices interval="5000" chance="10">
<voice sentence="YOU'LL NEVER GET MY TREASURE!"/>
</voices>
<loot>
</loot>
</monster>

<?xml version="1.0" encoding="UTF-8"?>
<creaturescripts>
<!-- XTibia.com -->
<event type="login" name="PlayerLogin" event="script" value="login.lua"/>
<event type="joinchannel" name="GuildMotd" event="script" value="guildmotd.lua"/>
<event type="receivemail" name="Mail" event="script" value="mail.lua"/>
<event type="reportbug" name="SaveReportBug" script="reportbug.lua"/>
<event type="advance" name="AdvanceSave" event="script" value="advancesave.lua"/>
<event type="think" name="Idle" event="script" value="idle.lua"/>
<event type="think" name="SkullCheck" event="script" value="skullcheck.lua"/>
<event type="death" name="pythiusTeleport" script="pythiusTeleport.lua" />
<event type="death" name="monster2" event="script" value="monster2.lua"/>
<event type="death" name="inquisitionPortals" script="teleports_inquisition.lua"/>


<!-- Custom systems -->
<event type="login" name="FirstItems" event="script" value="firstitems.lua"/>
<event type="kill" name="PlayerKill" event="script" value="arenakill.lua"/>
<event type="death" name="inquisitionPortals" event="script" value="inquisitionPortals.lua"/>
<event type="death" name="bluelegs" event="script" value="bluelegs.lua"/>
<event type="death" name="PlayerDeath" event="script" value="playerdeath.lua"/>
<event type="attack" name="AttackGuild" script="attackguild.lua"/>
<event type="login" name="FimVip" event="script" value="vip.lua"/>
<event type="logout" name="demonOakLogout" event="script" value="demonOakLogout.lua"/>
<event type="death" name="demonOakDeath" event="script" value="demonOakDeath.lua"/>
<event type="death" name="Azerus" event="script" value="azerus.lua"/>
<event type="kill" name="KillingInTheNameOf" event="script" value="killinginthenameof.lua"/>

</creaturescripts>
 
Last edited:
Do you have this script registered in both creaturescripts.xml, and the monster file?

small edit to the script:
Lua:
local time, pos = 200, {x=329, y=841, z=15}

local function remove()
	local v = getTileItemById(pos, 5023).uid
	if v > 0 then
		doRemoveItem(v)
		doSendMagicEffect(pos, CONST_ME_POFF)
	end
end

function onDeath(cid, corpse, deathList)
	if getCreatureName(cid):lower() == 'pythius the rotten' then
		doCreateTeleport(5023, {x=342, y=839, z=15}, pos)
		doSendMagicEffect(pos, CONST_ME_ENERGYHIT)
		doCreatureSay(cid, 'GOOO! You have less than ' .. time ..' seconds to enter the teleport!', TALKTYPE_ORANGE_1)
		addEvent(remove, time * 1000)
	end
	return true
end
okay, now copy it.
 
Last edited:
Back
Top