• 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!
  • New resources must be posted under Resources tab. A discussion thread will be created automatically, you can't open threads manually anymore.

CreatureEvent Pythius the rotten_teleport

Nerkoerko

Banned User
Joined
Feb 28, 2009
Messages
402
Reaction score
5
Location
Polska
function onDeath(cid, corpse, killer)

registerCreatureEvent(cid, "Pytthius the rottenTeleport")

local creaturename = getCreatureName(cid)
local in_pos = {x=924, y=3432, z=7, stackpos=2}
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=922, y=3432, z=7, stackpos=1}
local time_to_pass = 30 -- in seconds
local tpID = 1387

if creaturename == 'Pythius the rotten' then

teleport = doCreateTeleport(tpID, to_pos, in_pos)

doSendMagicEffect(in_pos, CONST_ME_TELEPORT)

doCreatureSay(cid, "You have 30 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
addEvent(removeTeleport, (1000*time_to_pass))


end
end

function removeTeleport()
if getThingfromPos({x=922, y=3432, z=7, stackpos=1}).itemid == 1387 then
doRemoveItem(getThingfromPos({x=924, y=3432, z=7, stackpos=1}).uid,1)
doSendMagicEffect({x=922, y=3432, z=7, stackpos=1}, CONST_ME_POFF)
return TRUE
end
end


<event type="death" name="pythius the rottenteleport" script="pythius the rotten_teleport.lua"/>












monster
<?xml version="1.0" encoding="utf-8"?>
<monster name="pythius the rotten" namedescription="a pythius the rotten" race="undead" experience="100" speed="300" manacost="0">
<health now="8350" max="8350"/>
<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>
<script>
<event name="pythius the rottenteleport"/>
</script>
<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="death" interval="3000" chance="20" range="7" min="-0" max="-600">
<attribute key="shooteffect" value="suddendeath"/>
</attack>

<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="1"/>
<immunity drown="1"/>
<immunity lifedrain="1"/>
<immunity paralyze="1"/>
<immunity invisible="1"/>
</immunities>
<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>

</monster>
 
Code:
function onDeath(cid, corpse, killer)
	registerCreatureEvent(cid, "Pytthius the rottenTeleport")
local creaturename = getCreatureName(cid)
local in_pos = {x=924, y=3432, z=7, stackpos=2}
local checkIID = getThingfromPos(in_pos)
local to_pos = {x=922, y=3432, z=7, stackpos=1}
local time_to_pass = 30 -- in seconds
local tpID = 1387
	if creaturename == 'Pythius the rotten' then
		teleport = doCreateTeleport(tpID, to_pos, in_pos)
		doSendMagicEffect(in_pos, CONST_ME_TELEPORT)
		doCreatureSay(cid, "You have 30 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1)
		addEvent(doRemoveItem, 1000 * 30, getThingfromPos({x = 924, y = 3432, z = 7, stackpos = 1}).uid, 1)
	end
	return false
end
better ;d
 
Code:
function onDeath(cid, corpse, deathList) return doCreateTeleport({x=922, y=3432, z=7}, {x=924, y=3432, z=7}) and doSendMagicEffect({x=924, y=3432, z=7}, CONST_ME_TELEPORT) and doCreatureSay(cid, "You have 30 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1) and addEvent(function() doRemoveItem(getTileItemById({x = 924, y = 3432, z = 7}, 1387).uid) end, 30 * 1000) end
better ;d
 
Code:
local config = {
        timeToRemove = 60, -- seconds
        teleportId = 9773,
        bosses = { -- Monster Name,  Teleport Position
                ["Pythius The Rotten"] = {  pos={ x=32572, y=31405, z=15, stackpos=1 }, aid=14061}
				},
}
local function removal(position)
	doRemoveThing(getTileItemById(position, config.teleportId).uid, 1)
    return TRUE
end

function onKill(cid, target, lastHit)
    if(config.bosses[getCreatureName(target)]) then
		local t = config.bosses[getCreatureName(target)]
	    local teleport = doCreateItem(config.teleportId, t.pos)
		local position = t.pos
		doItemSetAttribute(teleport, "aid", t.aid)
		addEvent(removal, config.timeToRemove * 1000, position)
		end
	return TRUE
end

;]
 
Code:
function onDeath(cid, corpse, deathList) return doCreateTeleport({x=922, y=3432, z=7}, {x=924, y=3432, z=7}) and doSendMagicEffect({x=924, y=3432, z=7}, CONST_ME_TELEPORT) and doCreatureSay(cid, "You have 30 seconds to enter the teleport before it is closed.", TALKTYPE_ORANGE_1) and addEvent(function() doRemoveItem(getTileItemById({x = 924, y = 3432, z = 7}, 1387).uid) end, 30 * 1000) end
better ;d

Roflmao, Cykotitan u pauwn!
 
Back
Top