• 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] Moving Statue (read for description)

dave182

New Member
Joined
Jan 23, 2009
Messages
80
Reaction score
3
Hi everybody, I need a script for a statue, for example a dwarvn statue, and i need a script to let it to move following someone and if it touchs the person, the person die. but i need the script to when it kills the person it backs to it's initial waypoint. I mean, for example, you pull a lever with (same as the annihilator) and when you pull it, you apepar on a room with the statue 5 sqm behind you and it starts to follow u. if it kills you, it backs to its initial waypoint. Could someone help me?
 
Haha great idea ;) This seems cool, just think about a quest where you should run in a labyrinth, and if you run wrong, then you will die since the statue will hit you :D haha that should be awesome :p and also, if you run correct, then you should enter a portal and come to reward room, and the statue should return to its initial spawn =)
 
Make a monster with statue looktype having uber high attack.
Edit playerdeath, so it will return FALSE if you are killed by the statue, renew your health/mana and teleport you to the startPos again.

OK.
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Amazon Statue" nameDescription="an amazon statue" race="undead" experience="0" speed="100" manacost="0">
	<health now="5000" max="5000"/>
	<look typeex="3739"/>
	<targetchange interval="5000" chance="20"/>
	<strategy attack="100" defense="0"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="0"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
		<flag pushable="0"/>
		<flag canpushitems="0"/>
		<flag canpushcreatures="1"/>
		<flag staticattack="90"/>
		<flag targetdistance="1"/>
		<flag runonhealth="100"/>
		<flag hidehealth="1"/>
	</flags>
	<attacks>
		<attack name="melee" interval="2000" min="-20000" max="-25000"/>
	</attacks>
	<defenses armor="1" defense="1"/>
	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity ice="1"/>
		<immunity holy="1"/>
		<immunity death="1"/>
		<immunity lifedrain="1"/>
		<immunity manadrain="1"/>
		<immunity paralyze="1"/>
		<immunity drunk="1"/>
		<immunity outfit="1"/>
		<immunity invisible="1"/>
	</immunities>
	<loot>
		<item id="2148" countmax="20" chance="100000"/>
	</loot>
</monster>

Code:
if (str.lower(getCreatureName(lastHitKiller)) == "amazon statue") then
	doCreatureSetHealth(cid, getCreatureMaxHealth(cid))
	doTeleportThing(cid, {x=,y=,z=})
	return false
end
 
Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Amazon Statue" nameDescription="an amazon statue" race="undead" experience="0" speed="100" manacost="0">
	<health now="5000" max="5000"/>
	<look typeex="3739"/>
	<targetchange interval="5000" chance="20"/>
	<strategy attack="100" defense="0"/>
	<flags>
		<flag summonable="0"/>
		<flag attackable="0"/>
		<flag hostile="1"/>
		<flag illusionable="0"/>
		<flag convinceable="0"/>
		<flag pushable="0"/>
		<flag canpushitems="0"/>
		<flag canpushcreatures="1"/>
		<flag staticattack="90"/>
		<flag targetdistance="1"/>
		<flag runonhealth="100"/>
		<flag hidehealth="1"/>
	</flags>
	<attacks>
		<attack name="melee" interval="2000" min="-20000" max="-25000"/>
	</attacks>
	<defenses armor="1" defense="1"/>
	<immunities>
		<immunity physical="1"/>
		<immunity energy="1"/>
		<immunity fire="1"/>
		<immunity poison="1"/>
		<immunity ice="1"/>
		<immunity holy="1"/>
		<immunity death="1"/>
		<immunity lifedrain="1"/>
		<immunity manadrain="1"/>
		<immunity paralyze="1"/>
		<immunity drunk="1"/>
		<immunity outfit="1"/>
		<immunity invisible="1"/>
	</immunities>
	<loot>
		<item id="2148" countmax="20" chance="100000"/>
	</loot>
</monster>

Code:
if (str.lower(getCreatureName(lastHitKiller)) == "amazon statue") then
	doCreatureSetHealth(cid, getCreatureMaxHealth(cid))
	doTeleportThing(cid, {x=,y=,z=})
	return false
end



Chojak, where to put them? =) also, it looks wierd with just two codes for this? Shouldnt there be like 4 codes for this? :p
 
First code is monster, so add it like an other monsters.
Put second code into playerdeath.lua in creaturescripts.
 
Lua:
local monster_pos = {x=,y=,z=}
local player_pos = {x=,y=,z=}

if (str.lower(getCreatureName(lastHitKiller)) == "amazon statue") then
	doCreatureAddHealth(cid, (getCreatureMaxHealth(cid)-getCreatureHealth(cid))
	doTeleportThing(cid, player_pos)
	doTeleportThing(lastHitKiller, monster_pos)
	return TRUE
end

Regards,
Shawak
 
Lua:
local monster_pos = {x=,y=,z=}
local player_pos = {x=,y=,z=}

if (str.lower(getCreatureName(lastHitKiller)) == "amazon statue") then
	doCreatureAddHealth(cid, (getCreatureMaxHealth(cid)-getCreatureHealth(cid))
	doTeleportThing(cid, player_pos)
	doTeleportThing(lastHitKiller, monster_pos)
	return TRUE
end

Regards,
Shawak

What to write on player_pos ? :) also, do I need to add a line in monsters.xml? ex:
Code:
<monster name="Amazon Statue" file="amazon statue.xml"/>
 
But i got another question, If the statue doesn't kill anyone, because the guy reach to the end, what happens to the sttue? does it backs to it's initial point or it keeps there until someones die?
 
It doesn't works, it gives me this error:
Code:
[21/07/2009 01:03:10] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/playerdeath.lua
[21/07/2009 01:03:10] data/creaturescripts/scripts/playerdeath.lua:34: unexpected symbol near ','

This is my code:
Lua:
local monster_pos = {x=366,y=603,z=7}
local player_pos = {x=366,y=598,z=7}

if (str.lower(getCreatureName(lastHitKiller)) == "amazon statue") then
        doCreatureAddHealth(cid), (getCreatureMaxHealth(cid)-getCreatureHealth(cid))
        doTeleportThing(cid, player_pos)
        doTeleportThing(lastHitKiller, monster_pos)
        return TRUE
end
 
It doesn't works, it gives me this error:
Code:
[21/07/2009 01:03:10] Warning: [Event::loadScript] Can not load script. data/creaturescripts/scripts/playerdeath.lua
[21/07/2009 01:03:10] data/creaturescripts/scripts/playerdeath.lua:34: unexpected symbol near ','

This is my code:
Lua:
local monster_pos = {x=366,y=603,z=7}
local player_pos = {x=366,y=598,z=7}

if (str.lower(getCreatureName(lastHitKiller)) == "amazon statue") then
        doCreatureAddHealth(cid), (getCreatureMaxHealth(cid)-getCreatureHealth(cid))
        doTeleportThing(cid, player_pos)
        doTeleportThing(lastHitKiller, monster_pos)
        return TRUE
end

Your code, i think it should be like this
This is my code:
Lua:
local monster_pos = {x=366, y=603, z=7}
local player_pos = {x=366, y=598, z=7}

I mean, You must separate the comas from the Y and the X
 
Back
Top