MoveEvent Complete: Koshei The Deathless

Nottinghster

Tibia World RPG Developer
Joined
Oct 24, 2007
Messages
1,472
Best answers
3
Reaction score
331
Location
Brazil - Rio de Janeiro
First of all - Credits go to FUGRA

:)This script is a duplicate of real tibia Koshei The Deathless room.:)

I Haven't made the npc yet been lazy but here we go.:D

Movements.xml
Code:
	<movevent event="StepIn" actionid="21190" script="darashia/Koshei the Deathless.lua" /> -- Door
	<movevent event="StepIn" actionid="21191" script="darashia/Koshei the Deathless.lua" /> -- Exit
Koshei the Deathless.lua

Code:
function onStepIn(cid, item, position, fromPosition)

Scheck = getPlayerStorageValue(cid, 83234)
ItemCheck = getPlayerItemCount(cid,8266)
out =  {x=position.x, y=position.y-1, z=position.z}
Spawn =  {x=position.x, y=position.y-10, z=position.z}

--Check Begin

--Area Check
starting={x=33264, y=32402, z=12, stackpos=253} --Top left corner
checking={x=starting.x, y=starting.y, z=starting.z, stackpos=starting.stackpos}
ending=  {x=33278, y=32417, z=12, stackpos=253} --Bottom right corner
--Area Check
players=0
totalmonsters=0
monster = {}
repeat
creature= getThingfromPos(checking)
if creature.itemid > 0 then
if isPlayer(creature.uid) == 1 then
players=players+1
end
if isCreature(creature.uid) then
totalmonsters=totalmonsters+1
monster[totalmonsters]=creature.uid
   end
end
checking.x=checking.x+1
if checking.x>ending.x then
checking.x=starting.x
checking.y=checking.y+1
end
until checking.y>ending.y
--Check Ending

if players == 0 and totalmonsters == 0 and ItemCheck > 0 then
	doSummonCreature("Koshei The Deathless", Spawn)


elseif players==0 then

current=0
repeat
current=current+1
doRemoveCreature(monster[current])
until current>=totalmonsters
end
end
Screen Shot:

 

freak15

Professional Hoster
Joined
Dec 31, 2008
Messages
355
Best answers
0
Reaction score
2
Location
Sweden
Please Add The npc Should be really great!
 

richux

Tibera.org
Joined
Aug 18, 2008
Messages
3,667
Best answers
0
Reaction score
24
Location
---------
fack! I know you! Your one of top kinas(u were nr1 when I played there :D ) on Empera, aren't ya?
 
Last edited:

marcryzius

New Member
Joined
Mar 22, 2009
Messages
61
Best answers
0
Reaction score
0
nice...
liked but if you used the (FOR) would greatly diminish the script.
 

Slain

TrueHavoc.com
Joined
Nov 27, 2008
Messages
2,241
Best answers
0
Reaction score
29
Why do you say this is complete, its not complete at all lol..this only summons koshei if theres no players in there, you need it to add a storage value when koshei is dead then the reward room requires the storage value to get in.

I would write it like you get a storage value if theres no monsters in there when your trying to leave (forcing you to kill koshei)
 

freak15

Professional Hoster
Joined
Dec 31, 2008
Messages
355
Best answers
0
Reaction score
2
Location
Sweden
Here is Koshei The Deathless monster

Code:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Koshei The Deathless" nameDescription="a koshei the deathless" race="UNDEAD" experience="0" speed="390" manacost="0">
  <health now="2000" max="2000"/>
  <look type="99" head="95" body="116" legs="119" feet="115" corpse="6028"/>
  <targetchange interval="5000" chance="8"/>
  <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>
  <attacks>
    <attack name="melee" interval="2000" min="-90" max="-190"/>
    <attack name="lifedrain" interval="3000" chance="9" range="1" min="-60" max="-250">
      <attribute key="areaEffect" value="blueshimmer"/>
    </attack>
    <attack name="cursecondition" interval="3000" chance="15" range="1" min="-54" max="-54"/>
    <attack name="speed" interval="2000" chance="15" range="7" speedchange="-900" duration="30000">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
    <attack name="lifedrain" interval="1000" chance="11" radius="3" target="0" min="-120" max="-200">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
    <attack name="lifedrain" interval="2000" chance="9" length="8" spread="0" min="-150" max="-295">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
    <attack name="poisoncondition" interval="3000" chance="9" length="8" spread="0" min="-300" max="-400">
      <attribute key="areaEffect" value="greenspark"/>
    </attack>
    <attack name="lifedrain" interval="3000" chance="9" range="7" radius="3" target="0" min="-90" max="-210">
      <attribute key="areaEffect" value="redshimmer"/>
    </attack>
  </attacks>
  <defenses armor="20" defense="20">
    <defense name="healing" interval="1000" chance="17" min="90" max="150">
      <attribute key="areaEffect" value="blueshimmer"/>
    </defense>
  </defenses>
  <elements>
  <element energyPercent="80"/>
  <element holyPercent="-15"/>
  <element firePercent="-10"/>
  </elements>
  <immunities>
    <immunity death="1"/>
    <immunity earth="1"/>
    <immunity paralyze="1"/>
    <immunity invisible="1"/>
  </immunities>
  <summons maxSummons="1">
    <summon name="bone beast" interval="1000" chance="16" max="1"/>
  </summons>
  <voices interval="5000" chance="10">
    <voice sentence="Your pain will be beyond imagination!"/>
    <voice sentence="You can't defeat me! I will ressurect and take your soul!"/>
    <voice sentence="Death is my ally!"/>
    <voice sentence="Welcome to my domain, visitor!"/>
    <voice sentence="You will be my toy on the other side!"/>
    <voice sentence="What a disgusting smell of life!"/>
  </voices>
  <loot>
  </loot>
</monster>
 
Last edited:

frankfarmer

who'r ninja now
Joined
Aug 5, 2008
Messages
1,472
Best answers
0
Reaction score
30
Location
swe?
How come i get errors? :p

I have 0.3.5 and i get moveevent errors in console.
 

Valania

Learning PHP/Lua
Joined
Oct 23, 2009
Messages
315
Best answers
0
Reaction score
1
Location
Germany
How come i get errors? :p

I have 0.3.5 and i get moveevent errors in console.
Maybe because you didn't changed the tiles in the map like on the screenshot? Might be a misstake. Maybe you could share with us which your error is.
 

Tovar

Brak V
Joined
Jul 26, 2008
Messages
347
Best answers
0
Reaction score
7
there is the npc, the cyclop on ab'dendriel.

make new file called A Sweaty Cyclops.xml

Code:
<?xml version="1.0" encoding="UTF-8"?>
<npc name="A Sweaty Cyclops" script="data/npc/scripts/Sweaty Cyclops.lua" walkinterval="2000" floorchange="0">
	<health now="100" max="100"/>
	<look type="22" head="0" body="0" legs="0" feet="0"/>
	<parameters>
		<parameter key="message_greet" value="Hum Humm! Welcume |PLAYERNAME|." />
		<parameter key="message_decline" value="Alright then. Come back when you got the neccessary items." />		
		<parameter key="message_walkaway" value="Farewell, human." />
		<parameter key="module_keywords" value="1" />
		<parameter key="keywords" value="job" />
		<parameter key="keyword_reply1" value="I'm an forger." />
	</parameters>
</npc>
then make new file inside npc/scripts called Sweaty Cyclops.lua

Code:
local keywordHandler = KeywordHandler:new()
local npcHandler = NpcHandler:new(keywordHandler)
NpcSystem.parseParameters(npcHandler)

function onCreatureAppear(cid)            npcHandler:onCreatureAppear(cid)        end
function onCreatureDisappear(cid)        npcHandler:onCreatureDisappear(cid)        end
function onCreatureSay(cid, type, msg)        npcHandler:onCreatureSay(cid, type, msg)    end
function onThink()                npcHandler:onThink()                end

-- XVX FORGER START --

function amulet(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,8262) >= 1 and getPlayerItemCount(cid,8263) >= 1 and getPlayerItemCount(cid,8264) >= 1 and  getPlayerItemCount(cid,8265) >= 1 then
        if doPlayerRemoveItem(cid,8262,1) and doPlayerRemoveItem(cid,8263,1) and doPlayerRemoveItem(cid,8264,1) and  doPlayerRemoveItem(cid,8265,1) and (doPlayerRemoveMoney(cid, 5000) == TRUE) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,8266,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
    end
end

function obsidian(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,2516) >= 1 and getPlayerItemCount(cid,2425) >= 1 then
        if doPlayerRemoveItem(cid,2516,1) and doPlayerRemoveItem(cid,2425,1) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5908,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
    end
end	

function crude(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,5879) >= 1 then
        if doPlayerRemoveItem(cid,5879,1) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5892,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
    end
end

function draconian(cid, message, keywords, parameters, node)
    if(not npcHandler:isFocused(cid)) then
        return false
    end
        if getPlayerItemCount(cid,2516) >= 1 then
        if doPlayerRemoveItem(cid,2516,1) then
            npcHandler:say('Here is your item!', cid)
            doPlayerAddItem(cid,5889,1)
        end
        else
            npcHandler:say('You don\'t have these items!', cid)
   end   
end

-- XVX FORGER END --

keywordHandler:addKeyword({'help'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = "I can forge Amulet, Obsidian Knife, Huge Chunk of Crude Iron and Piece of Draconian Steel!"})

local node1 = keywordHandler:addKeyword({'amulet'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Hum Humm! Welcume lil. Me can do unbroken but Big Ben want gold 5000 and Big Ben need a lil time to make it unbroken. Yes or no??'})
    node1:addChildKeyword({'yes'}, amulet, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node1:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})

local node2 = keywordHandler:addKeyword({'obsidian'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a Dragon Shield and an Obsidian Lance for a Obsidian Knife?'})
    node2:addChildKeyword({'yes'}, obsidian, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node2:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})

local node3 = keywordHandler:addKeyword({'crude'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a Giant Spider Silk for a Huge Chunk of Crude Iron?'})
    node3:addChildKeyword({'yes'}, crude, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node3:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})
	
local node4 = keywordHandler:addKeyword({'draconian'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Do you want to trade a Dragon Shield for a Piece of Draconian Steel?'})
    node4:addChildKeyword({'yes'}, draconian, {npcHandler = npcHandler, onlyFocus = true, reset = true})
    node4:addChildKeyword({'no'}, StdModule.say, {npcHandler = npcHandler, onlyFocus = true, text = 'Alright then. Come back when you got the neccessary items.', reset = true})

npcHandler:addModule(FocusModule:new())
:eek::p
 

bivan

New Member
Joined
Dec 18, 2008
Messages
125
Best answers
0
Reaction score
0
When I enter the doors player was logout. Room is empty, no player no monster. What the fuck?
 
Top