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

CreatureEvent Various Creaturescripts by Kyou

kyoushirou

I like trains
Joined
Apr 29, 2009
Messages
224
Reaction score
58
Some of these scripts might have been posted before, but all of these are made 100% by me.

Make sure you rep me if you use them!

Oh right, these scripts were made for Crying Damson 0.3.4.

Also, I just took these from my post on OTFans, so the BB code might be fucked up.

Kill X Monsters

Heres a quest where you have to kill x creatures.

Please note that You'll still have to register the event in login.lua for it to work. :p

Kill X Monsters said:
Code:
function onKill(cid, target)
-- Config --
local StorageValue = 0000 -- Storage Value that should be used
local Creatures = "Rat" --Monster that should be killed
local KillCount = 20 -- How many monsters should be killed (When the quest is completed, the players storage value will be 1 more then the killcount!)  
-- Don't Edit --
local CreaturesKilled = getPlayerStorageValue(cid, StorageValue)
-- Config End --
	if CreaturesKilled >= 1 and CreaturesKilled <= KillCount then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have killed " .. CreaturesKilled .. " " .. Creatures .. "s.")
		setPlayerStorageValue(cid, StorageValue, CreaturesKilled + 1)
			elseif CreaturesKilled >= Killcount + 1 then
				doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You have already killed " .. CreaturesKilled - 1 .. " " .. Creatures .. "s.")
	end
end


______________________________________________________








Loot List

A script that jordanhenry helped me with! :p

It sends text with the loot of the killed creature that its added too, good for bosses. Could be edited so loot is broadcasted instead.


Loot List said:
Code:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local name = getCreatureName(cid)
    local text = ""
    if isPlayer(mostDamageKiller) == TRUE and getContainerItem(corpse.uid, 0).uid > 0 then
        local loot = {}
        for i = 1, getContainerSize(corpse.uid) do
            loot[i] = getContainerItem(corpse.uid, i-1)
        end
        for i, v in pairs(loot) do
            if text == "" then
                text = "Loot from "..name..": "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemName(v.uid)
            else
                text = text..", "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemName(v.uid)
            end
        end
        text = text.."."
    else
        text = "Loot from "..name..": Nothing."
    end
    doPlayerSendTextMessage(mostDamageKiller, MESSAGE_STATUS_CONSOLE_ORANGE, text)
    return TRUE
end


______________________________________________________








EXP Bug Creaturescript

EXP Bug Script, set the monster exp as 0 in the monster file then add this script to the monster.
Adds x lvls/kill!

EXP Bug said:
Code:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
	local kPos = getPlayerPosition(mostDamageKiller)
        local name = "EXP Bug" -- Creature Name
        local levels = 5 -- How many levels it should give.
	if getCreatureName(cid) == name then -- Name check for the correct monster
		doSendAnimatedText(getPlayerPosition(mostDamageKiller), "+ " .. levels .. " Levels!", TEXTCOLOR_RED)
		doPlayerAddExp(lastHitKiller, getExperienceForLevel(getPlayerLevel(lastHitKiller) + levels) - getPlayerExperience(lastHitKiller))
	end
	end


______________________________________________________









Teleporting Ring

And here's a script that will TP a player to the pos where he looks if he has a special ring, and if there are no walls in the way of where he's looking.. Untested!

Teleporting Ring said:
Code:
function onLook(cid, thing, position, lookDistance)

local item = "Ring of the sky" -- Ring that the player needs to have to teleport...
local lol = getItemIdByName(item)
local storage = 5555 -- Storage Value the ring uses

	if isSightClear(getCreaturePosition(cid), position, 1) and getPlayerSlotItem(cid, CONST_SLOT_RING) == lol and getPlayerStorageValue(cid, storage) == 2 then
		doSendMagicEffect(getCreaturePosition(cid), CONST_ME_POFF)
		doSendMagicEffect(position, CONST_ME_TELEPORT)
			doTeleportThing(cid, position, 1)
	end
	end

Here's the code to activate/de-activate the ring...

Code:
function onUse(cid, item, fromPosition, itemEx, toPosition)
	
	local storage = 5555 -- Storage Value the ring uses
	
	if getPlayerStorageValue(cid, storage) == 1 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The ring is now activated. Look at a position to teleport there.")
			setPlayerStorageValue(cid, storage, 2)
		elseif getPlayerStorageValue(cid, storage) == 2 then
			doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "The ring is now deactivated.")
				setPlayerStorageValue(cid, storage, 1)
	else 
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR, "You may not use this ring.")
	end
end






________________________________________________________

Deathnote Edit!

An edit of this script.

Basically, its a book.. and you write a players name in it, after 40 sec the player dies and you get a white skull for 15 min, also the corpse says that you killed the player.

Deathnote Edit! said:
Code:
function onTextEdit(cid, item, newText)

	local corpse = getThingFromPos(getPlayerPosition(getCreatureByName(newText)))
	local health = getCreatureHealth(getCreatureByName(newText))
	local killed = getCreatureName(getCreatureByName(newText))
	local killer = getCreatureName(cid)
	local minutes = 15 -- How many minutes you should have pz after killing someone
	local reuse = 120 -- how many minutes before you can use the book again

			local function reset()
				doTransformItem(item, item.itemid-1)
			end
	
				local function unskull()
					doCreatureSetSkullType(cid, 0)
				end
	
		local function timer()
			if getPlayerSex(killed) == 1 then
				doPlayerSendTextMessage(killed,22,"You had a heart attack!")
				doCreatureAddHealth(getCreatureByName(killed), -health)
				doSetItemSpecialDescription(corpse, "You recognize " .. killed ..". He was killed by " .. killer .. " using a deathnote.")
				addEvent(reset,60000*reuse,nil)
					if getCreatureSkullType(cid) == 0 then 
						doCreatureSetSkullType(cid, 1)
							addEvent(unskull,60000*minutes,nil)
					end
			else
				doPlayerSendTextMessage(killed,22,"You had a heart attack!")
				doCreatureAddHealth(getCreatureByName(killed), -health)
				doSetItemSpecialDescription(corpse, "You recognize " .. killed ..". She was killed by " .. killer .. " using a deathnote.")
				addEvent(reset,60000*reuse,nil)
					if getCreatureSkullType(cid) == 0 then 
						doCreatureSetSkullType(cid, 1)
							addEvent(unskull,60000*minutes,nil)
					end
			end
		end


  if isPlayer(killed) then
	if getPlayerSex(killed) == 1 then
		doPlayerSendTextMessage(cid,22,"" .. killed .. "'s name was written in the deathnote and he will die in 40 seconds!")
		addEvent(timer,40000,nil) 
	elseif getPlayerSex(killed) == 0 then
		doPlayerSendTextMessage(cid,22,"" .. killed .. "'s name was written in the deathnote and she will die in 40 seconds!")
		addEvent(timer,40000,nil)
	end
  else
	doPlayerSendTextMessage(cid,22,"" .. killed .. " is not alive..")
  end
  return TRUE
end
 
Almost 99% of these were all released. As for i know the Loot one was made by Azi.
 
Hehe usefull, thanks.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Deathnote has no pz check. You might add a name in the book, run to temple, and sit out your skull
 
Almost 99% of these were all released. As for i know the Loot one was made by Azi.

None of these scripts were ripped or stolen, I made them all myself.

Deathnote has no pz check. You might add a name in the book, run to temple, and sit out your skull


Thats cause I found no condition pzlock @ tfs and I was way to lazy to make a movement and fix storage to that..
 
Example -- PZ Lock

Lua:
local newPos = {x=100, y=100, z=7}
function onUse(cid, item, fromPosition, itemEx, toPosition)
    if getCreatureCondition(cid, CONDITION_INFIGHT) == FALSE then
        doTeleportThing(cid, newPos)
    else
        doPlayerSendCancel(cid, "You cannot use this while fighting.")
    end
    return TRUE
end

Hopefully this will help you out. :thumbup:
 
Last edited:
So

Code:
setCreatureCondition(cid, CONDITION_INFIGHT)

Even if that works I have to get a command to remove it.
 
Yet you claim those scripts to be your own but you can't even write proper things...

Next time write the real credits, or don't even open a thread, you'll let yourself look retarded in the end.

:thumbup:
 
Yet you claim those scripts to be your own but you can't even write proper things...

Next time write the real credits, or don't even open a thread, you'll let yourself look retarded in the end.

:thumbup:

I made these scripts myself 100%. Except the loot one, I got help on that one.

Just because I can't make a function that doesnt exist it doesnt make my scripts stolen. I bet you're just jealous cause I got better ideas then you and actually release them.


I bet you didnt even read the scripts to check what the problem was.

In the deathnote I made an onTextEdit script that makes the player skulled for x minutes, but not PZ locked. I could'nt make the player pzlocked cause I got no function for that.
 
Lua:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local name = getCreatureName(cid)
    local text = ""
    if isPlayer(mostDamageKiller) == TRUE and getContainerItem(corpse.uid, 0).uid > 0 then
        local loot = {}
        for i = 1, getContainerSize(corpse.uid) do
            loot[i] = getContainerItem(corpse.uid, i-1)
        end
        for i, v in pairs(loot) do
            if text == "" then
                text = "Loot from "..name..": "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemName(v.uid)
            else
                text = text..", "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemName(v.uid)
            end
        end
        text = text.."."
    else
        text = "Loot from "..name..": Nothing."
    end
    doPlayerSendTextMessage(mostDamageKiller, MESSAGE_STATUS_CONSOLE_ORANGE, text)
    return TRUE
end

Too bad it doesn't show loot from bags...
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
Lua:
function onDeath(cid, corpse, lastHitKiller, mostDamageKiller)
    local name = getCreatureName(cid)
    local text = ""
    if isPlayer(mostDamageKiller) == TRUE and getContainerItem(corpse.uid, 0).uid > 0 then
        local loot = {}
        for i = 1, getContainerSize(corpse.uid) do
            loot[i] = getContainerItem(corpse.uid, i-1)
        end
        for i, v in pairs(loot) do
            if text == "" then
                text = "Loot from "..name..": "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemName(v.uid)
            else
                text = text..", "..(v.type == 0 and getItemArticle(v.uid) or v.type).." "..getItemName(v.uid)
            end
        end
        text = text.."."
    else
        text = "Loot from "..name..": Nothing."
    end
    doPlayerSendTextMessage(mostDamageKiller, MESSAGE_STATUS_CONSOLE_ORANGE, text)
    return TRUE
end

Too bad it doesn't show loot from bags...

I'll fix that later ;)..
 
No, it just shows bag as loot, example loot from rat: bag, 10 gold coins, cheese, should be something like 10 gp, 2 gp, (<-- from bag) 10 gp, cheese.
__________________
klekSu.png

You are welcome on kleksoria.com!
Please visit new open tibia forum with it's own ots list. otservers.net!
 
Last edited:
I made these scripts myself 100%. Except the loot one, I got help on that one.

Just because I can't make a function that doesnt exist it doesnt make my scripts stolen. I bet you're just jealous cause I got better ideas then you and actually release them.


I bet you didnt even read the scripts to check what the problem was.

In the deathnote I made an onTextEdit script that makes the player skulled for x minutes, but not PZ locked. I could'nt make the player pzlocked cause I got no function for that.


PHP:
setCreatureCondition(cid, CONDITION_INFIGHT)
?

PHP:
doRemoveCondition(cid, CONDITION_INFIGHT)
?
 
Back
Top