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

Action Usefull scripts pack

Erikas Kontenis

Board Moderator
Staff member
Board Moderator
Joined
Jul 3, 2009
Messages
1,893
Reaction score
618
Location
Lithuania
Tested on tfs 0.2.9-0.2.10 it should work fine with 0.3. well since i stopt working with my real map project and started to take a look in something difference huh, I now developing pokemons, that sounds so funny i self joked :D so, in thoose scripts aint something special or very uncreteable but by that reason 0.2 versions by players is not very useable from this post might be, some of them will use it for sure...

The sadness thing i self know im kinda old dog and propapbly i wont create real map project next time so to know going to do windows restart i post my usefull files here...

Remember scripts are made not for public it was for me.

Zao arena

LUA:
<action uniqueid="32145" script="zao/arena.lua"/>
LUA:
local room = {     -- room with demons
        fromX = 33053,
        fromY = 31025,
        fromZ = 3,

        toX = 33073,
        toY = 31044,
        toZ = 3
        }
		
		 

        local players_pos = {
        {x = 33080, y =31014, z = 2, stackpos = 253},
        {x = 33081, y =31014, z = 2, stackpos = 253}
        }

        local new_player_pos = {
        {x = 33059, y = 31032, z = 3},
        {x = 33057, y = 31034, z = 3}
        }

        local playersOnly = "yes"
        local questLevel = 80
 
function getCreaturesInRange(position, radiusx, radiusy, showMonsters, showPlayers, showSummons, fromPosition, toPosition)
	local creaturesList = {}
	for x = -radiusx, radiusx do
		for y = -radiusy, radiusy do
			if not (x == 0 and y == 0) then
				creature = getTopCreature({x = position.x+x, y = position.y+y, z = position.z, stackpos = 253})
				if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
					table.insert(creaturesList, creature.uid)
				end
			end
		end
	end
 
	local creature = getTopCreature(position)
	if (creature.type == 1 and showPlayers == TRUE) or (creature.type == 2 and showMonsters == TRUE and (showSummons == FALSE or (showSummons == TRUE and getCreatureMaster(creature.uid) == (creature.uid)))) then
		if not(table.find(creaturesList, creature.uid)) then
			table.insert(creaturesList, creature.uid)
		end
	end
    return creaturesList
end
 
function Wave1()
       doSendMagicEffect(getCreaturePosition(doSummonCreature('Baron Brute', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doSummonCreature('The Axeorcist', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave2, 30 * 1000)
end
 
function Wave2()
       doSendMagicEffect(getCreaturePosition(doSummonCreature('Menace', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doSummonCreature('Fatality', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT) 
	addEvent(Wave3, 35 * 1000)
end
 
function Wave3()
       doSendMagicEffect(getCreaturePosition(doSummonCreature('Incineron', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doSummonCreature('Coldheart', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave4, 40 * 1000)
end
 
function Wave4()
       doSendMagicEffect(getCreaturePosition(doSummonCreature('Dreadwing', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doSummonCreature('Doomhowl', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave5, 40 * 1000)
end
 
function Wave5()
       doSendMagicEffect(getCreaturePosition(doSummonCreature('Haunter', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave6, 40 * 1000)
end
 
function Wave6()
       doSendMagicEffect(getCreaturePosition(doSummonCreature('The Dreadorian', {x = 33064, y = 31033, z = 3})), CONST_ME_TELEPORT)
	doSendMagicEffect(getCreaturePosition(doSummonCreature('Rocko', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
       doSendMagicEffect(getCreaturePosition(doSummonCreature('Tremorak', {x = 33064, y = 31032, z = 3})), CONST_ME_TELEPORT)
	addEvent(Wave7, 40 * 1000)
end
 
function Wave7()
	doSendMagicEffect(getCreaturePosition(doSummonCreature('Tirecz', {x = 33065, y = 31034, z = 3})), CONST_ME_TELEPORT)
end
 
function onUse(cid, item, fromPosition, itemEx, toPosition)
        local all_ready, monsters, player, level = 0, 0, {}, 0
        if item.itemid == 1945 then
                for i = 1, #players_pos do
                        table.insert(player, 0)
                end
                for i = 1, #players_pos do
                        player[i] = getThingfromPos(players_pos[i])
                        if player[i].itemid > 0 then
                                if string.lower(playersOnly) == "yes" then
                                        if isPlayer(player[i].uid) == TRUE then
                                                all_ready = all_ready+1
                                        else
                                                monsters = monsters+1
                                        end
                                else
                                        all_ready = all_ready+1
                                end
                        end
                end
                if all_ready == #players_pos then
                        for i = 1, #players_pos do
                                player[i] = getThingfromPos(players_pos[i])
                                if isPlayer(player[i].uid) == TRUE then
                                        if getPlayerLevel(player[i].uid) >= questLevel then
                                                level = level+1
                                        end
                                else
                                        level = level+1
                                end
                        end
                        if level == #players_pos then
                                if string.lower(playersOnly) == "yes" and monsters == 0 or string.lower(playersOnly) == "no" then
                                       
                                        for i = 1, #players_pos do
                                                doSendMagicEffect(players_pos[i], CONST_ME_POFF)
                                                doTeleportThing(player[i].uid, new_player_pos[i], FALSE)
                                                doSendMagicEffect(new_player_pos[i], CONST_ME_ENERGYAREA)
                                                doTransformItem(item.uid,1946)
                                        end
										Wave1()
                                else
                                        doPlayerSendTextMessage(cid,19,"Only players can do this quest.")
                                end
                        else
                                doPlayerSendTextMessage(cid,19,"All Players have to be level "..questLevel.." to do this quest.")
                        end
                else
                        doPlayerSendTextMessage(cid,19,"You need "..table.getn(players_pos).." players to do this quest.")
                end
        elseif item.itemid == 1946 then
                local player_room = 0
                for x = room.fromX, room.toX do
                        for y = room.fromY, room.toY do
                                for z = room.fromZ, room.toZ do
                                        local pos = {x=x, y=y, z=z,stackpos = 253}
                                        local thing = getThingfromPos(pos)
                                        if thing.itemid > 0 then
                                                if isPlayer(thing.uid) == TRUE then
                                                        player_room = player_room+1
                                                end
                                        end
                                end
                        end
                end
                if player_room >= 1 then
                        doPlayerSendTextMessage(cid,19,"There is already a team in the quest room.")          
                elseif player_room == 0 then
                        for x = room.fromX, room.toX do
                                for y = room.fromY, room.toY do
                                        for z = room.fromZ, room.toZ do
                                                local pos = {x=x, y=y, z=z,stackpos = 253}
                                                local thing = getThingfromPos(pos)
                                                if thing.itemid > 0 then
                                                        doRemoveCreature(thing.uid)
                                                end
                                        end
                                end
                        end
                        doTransformItem(item.uid,1945)
                end
        end
        return TRUE
end

Picture make sure that theres aint any black files i mean not filled tiles if you have no tile script wont work... and dont take a look in pokes sprites...



Items on login this is what i used... i'm thinking i gues i have posted that same script in other thread but not remember good... and felt lazy for use sreach.

LUA:
function onLogin(cid)
	if getPlayerGroupId(cid) == 1 and getPlayerStorageValue(cid, 50000) == -1 then
		if isSorcerer(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
	
			doAddContainerItem(bag, 2120, 1) -- Rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coints
			doAddContainerItem(bag, 2137, 1) -- Golden bless

		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2190, 1) -- wand of wortex
			doPlayerAddItem(cid, 8819, 1) -- magician's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			
			local text = "Erikas,"

			text = text .. "\n\n Welcome to the pheonix community, please read our library section for sure information. \n\n Please eat golden fruit now as reward from me, becouse later can be to late."
		
		doShowTextDialog(cid, 5956, text)
		
		setPlayerStorageValue(cid, 50000, 1)

		elseif isDruid(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2137, 1) -- Golden bless
		
			doPlayerAddItem(cid, 2175, 1) -- spellbook
			doPlayerAddItem(cid, 2182, 1) -- snakebite rod
			doPlayerAddItem(cid, 8819, 1) -- magican's robe
			doPlayerAddItem(cid, 8820, 1) -- mage hat
			doPlayerAddItem(cid, 2468, 1) -- studded legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			
			local text = "Erikas,"

			text = text .. "\n\n Welcome to the pheonix community, please read our library section for sure information. \n\n Please eat golden fruit now as reward from me, becouse later can be to late."
		
		doShowTextDialog(cid, 5956, text)
		
			setPlayerStorageValue(cid, 50000, 1)

		elseif isPaladin(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2137, 1) -- Golden bless
		
			doPlayerAddItem(cid, 2389, 1) -- spear
            doPlayerAddItem(cid, 2456, 1) -- bow
			doPlayerAddItem(cid, 2544, 100) -- 100 arrows
                     doPlayerAddItem(cid, 2509, 1) -- steel shield
			doPlayerAddItem(cid, 2660, 1) -- hidden turban
			doPlayerAddItem(cid, 2480, 1) -- legion helmet
			doPlayerAddItem(cid, 8923, 1) -- ranger legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			local text = "Erikas,"

			text = text .. "\n\n Welcome to the pheonix community, please read our library section for sure information. \n\n Please eat golden fruit now as reward from me, becouse later can be to late."
		
		doShowTextDialog(cid, 5956, text)
		
			setPlayerStorageValue(cid, 50000, 1)

		elseif isKnight(cid) then
			local bag = doPlayerAddItem(cid, 1988, 1)
			doAddContainerItem(bag, 2120, 1) -- rope
			doAddContainerItem(bag, 2554, 1) -- shovel
			doAddContainerItem(bag, 2152, 50) -- 50 platinum coins
			doAddContainerItem(bag, 2137, 1) -- Golden bless
			doAddContainerItem(bag, 2439, 1) -- daramanian mace
			doAddContainerItem(bag, 8601, 1) -- steel axe
		
			doPlayerAddItem(cid, 2509, 1) -- steel shield
			doPlayerAddItem(cid, 8602, 1) -- jagged sword
			doPlayerAddItem(cid, 2465, 1) -- brass armor
			doPlayerAddItem(cid, 2481, 1) -- soldier helmet
			doPlayerAddItem(cid, 2478, 1) -- brass legs
			doPlayerAddItem(cid, 2643, 1) -- leather boots
			doPlayerAddPremiumDays(cid, 350) -- automaticly 350 premmium days for servers who dont got free premmium function in config.lua Example: Chronic Elements

			local text = "Erikas,"

			text = text .. "\n\n Welcome to the pheonix community, please read our library section for sure information. \n\n Please eat golden fruit now as reward from me, becouse later can be to late."
		
		doShowTextDialog(cid, 5956, text)
		
			setPlayerStorageValue(cid, 50000, 1)
		end
	end
 	return TRUE
end

if you planning to use my first items take a this script as action too it will give for a newbie nice food.

LUA:
<action itemid="2137" script="other/bless.lua"/>

LUA:
function onUse(cid, item, frompos, item2, topos)
local fail = 0

	for i = 1, 5 do
		if getPlayerBlessing(cid, i) then
			fail = fail + 1
		else
			if getPlayerLevel(cid) < 20 then
				doPlayerAddBlessing(cid, i)
				if i == 5 and not(fail == 5) then
					doSendMagicEffect(getPlayerPosition(cid), CONST_ME_HOLYDAMAGE)
					doRemoveItem(item.uid, 1)
				
				
				break
			end
		end
	end
	if fail == 5 then
		doPlayerSendCancel(cid, "Only players with 20 level or above can use!")
	end
	
	if getPlayerLevel(cid) < 20 then
	doPlayerSendCancel(cid, "You are full blessed!")
	end

end
return TRUE
end
 
Last edited:
Very wierd made doq, but however it made, that part with tree dont work its an other script made in movement.

LUA:
<action itemid="8293" script="Oak/demonOak.lua"/>
	<action uniqueid="55100" script="Oak/demonOakGravestone.lua"/>
	<action fromuid="12901" touid ="12904" script="Oak/demonOakChests.lua"/>

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

--- Config --
blocktree = {32193} --- The uniqueid of the dead tree. ---
levelneeded = 120 --- How much level you need to enter the arena ---

--- First part ---
summonweak1Position = {x=32711, y=32348, z=7}
summonweak2Position = {x=32712, y=32354, z=7}
summonweak3Position = {x=32720, y=32354, z=7}
summonweak4Position = {x=32720, y=32347, z=7}
summonweakone1Position = {x=32719, y=32347, z=7}
summonweakone2Position = {x=32714, y=32347, z=7}
summonweakone3Position = {x=32710, y=32354, z=7}
summonweakone4Position = {x=32718, y=32354, z=7}
summonweaktwo1Position = {x=32717, y=32346, z=7}
summonweaktwo2Position = {x=32710, y=32348, z=7}
summonweaktwo3Position = {x=32709, y=32352, z=7}
summonweaktwo4Position = {x=32724, y=32353, z=7}

--- Second Part ---
summonnormal1Position = {x=32711, y=32348, z=7}
summonnormal2Position = {x=32712, y=32354, z=7}
summonnormal3Position = {x=32720, y=32354, z=7}
summonnormal4Position = {x=32720, y=32347, z=7}
summonnormalone1Position = {x=32719, y=32347, z=7}
summonnormalone2Position = {x=32714, y=32347, z=7}
summonnormalone3Position = {x=32710, y=32354, z=7}
summonnormalone4Position = {x=32718, y=32354, z=7}
summonnormaltwo1Position = {x=32717, y=32346, z=7}
summonnormaltwo2Position = {x=32710, y=32348, z=7}
summonnormaltwo3Position = {x=32709, y=32352, z=7}
summonnormaltwo4Position = {x=32724, y=32353, z=7}

--- Third Part ---
summonmedium1Position = {x=32711, y=32348, z=7}
summonmedium2Position = {x=32712, y=32354, z=7}
summonmedium3Position = {x=32720, y=32354, z=7}
summonmedium4Position = {x=32720, y=32347, z=7}
summonmediumone1Position = {x=32719, y=32347, z=7}
summonmediumone2Position = {x=32714, y=32347, z=7}
summonmediumone3Position = {x=32710, y=32354, z=7}
summonmediumone4Position = {x=32718, y=32354, z=7}
summonmediumtwo1Position = {x=32717, y=32346, z=7}
summonmediumtwo2Position = {x=32710, y=32348, z=7}
summonmediumtwo3Position = {x=32709, y=32352, z=7}
summonmediumtwo4Position = {x=32724, y=32353, z=7}

--- Fourth Part ---
summonhard1Position = {x=32711, y=32348, z=7}
summonhard2Position = {x=32712, y=32354, z=7}
summonhard3Position = {x=32720, y=32354, z=7}
summonhard4Position = {x=32720, y=32347, z=7}
summonhardone1Position = {x=32719, y=32347, z=7}
summonhardone2Position = {x=32714, y=32347, z=7}
summonhardone3Position = {x=32710, y=32354, z=7}
summonhardone4Position = {x=32724, y=32353, z=7}

--- Teleport Back Positions ---
back1Position = {x=32716, y=32341, z=7}
back2Position = {x=32715, y=32340, z=7}
back3Position = {x=32717, y=32340, z=7}
back4Position = {x=32716, y=32339, z=7}
back5Position = {x=32716, y=32338, z=6}

--- End Config ---

demonoak = {8288, 8289, 8290, 8291}

if itemEx.itemid == 2709 and itemEx.itemuid == blocktree and getPlayerLevel(cid) >= levelneeded and (getPlayerStorageValue(cid, 21544) == 3) == FALSE then
	doTransformItem(itemEx.uid, 3669)
	doTeleportThing(cid, toPosition, TRUE)
elseif itemEx.itemid == 8288 or itemEx.itemid == 8289 or itemEx.itemid == 8290 or itemEx.itemid == 8291 then
	if getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == -1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21541, 1)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Diabolic Imp", summonweak1Position)
			doSummonCreature("Warlock", summonweak2Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21541, 2)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Nightmare", summonweakone1Position)
			doSummonCreature("Dragon Lord", summonweakone3Position)
			doSummonCreature("Grim Reaper", summonweakone4Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 2 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21541, 3)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Hand of cursed fate", summonweaktwo1Position)
			doSummonCreature("Hellfire Fighter", summonweaktwo2Position)
			doSummonCreature("Juggernaut", summonweaktwo4Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
			if itemEx.itemid == 8288 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8289 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8290 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8291 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			end
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -270, -310, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == -1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21542, 1)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Juggernaut", summonnormal1Position)
			doSummonCreature("Demon", summonnormal2Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21542, 2)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Juggernaut", summonnormal1Position)
			doSummonCreature("Demon", summonnormalone2Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 2 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21542, 3)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Demon", summonnormaltwo1Position)
			doSummonCreature("Demon", summonnormaltwo2Position)
			doSummonCreature("Demon", summonnormaltwo3Position)
			doSummonCreature("Demon", summonnormaltwo4Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
			if itemEx.itemid == 8288 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8289 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8290 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8291 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			end
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == -1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21543, 1)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Juggernaut", summonmedium2Position)
			doSummonCreature("Demon", summonmedium3Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21543, 2)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Grim Reaper", summonmediumone1Position)
			doSummonCreature("Grim Reaper", summonmediumone2Position)
			doSummonCreature("Juggernaut", summonmediumone3Position)
			doSummonCreature("Juggernaut", summonmediumone4Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 2 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21543, 3)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Demon", summonmediumtwo1Position)
			doSummonCreature("Warlock", summonmediumtwo2Position)
			doSummonCreature("Demon", summonmediumtwo3Position)
			doSummonCreature("Demon", summonmediumtwo4Position)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
			if itemEx.itemid == 8288 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8289 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8290 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			elseif itemEx.itemid == 8291 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
			end
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == -1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21545, 1)
			doSendMagicEffect(toPosition, 0)
			doSummonCreature("Rat", summonhard3Position)
			doPlayerTakeItem(cid,8293,1)
			doPlayerAddItem(cid,2386,1)
			doTeleportThing(cid, {x=32715, y=32336, z=7})
			doPlayerSendTextMessage(cid, 20, 'THAT WAS THE LAST TIME YOU TOUCHED ME! NOW DIE!')
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -800, -1000, CONST_ME_BIGPLANTS)

		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 1 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21544, 2)
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	elseif getPlayerStorageValue(cid, itemEx.itemid) == -1 and getPlayerStorageValue(cid, 21541) == 3 and getPlayerStorageValue(cid, 21542) == 3 and getPlayerStorageValue(cid, 21543) == 3 and getPlayerStorageValue(cid, 21544) == 2 then
		if math.random(1, 2) == 1 then
			setPlayerStorageValue(cid, 21544, 3)
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
			if itemEx.itemid == 8288 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
					if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
					setPlayerStorageValue(cid, 21545, 1)
					if math.random(1, 5) == 1 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back1Position)
					elseif math.random(1, 5) == 2 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back2Position)
					elseif math.random(1, 5) == 3 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back3Position)
					elseif math.random(1, 5) == 4 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back4Position)
					elseif math.random(1, 5) == 5 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back5Position)
					end
				end
			elseif itemEx.itemid == 8289 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
				if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
					setPlayerStorageValue(cid, 21545, 1)
					if math.random(1, 5) == 1 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back1Position)
					elseif math.random(1, 5) == 2 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back2Position)
					elseif math.random(1, 5) == 3 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back3Position)
					elseif math.random(1, 5) == 4 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back4Position)
					elseif math.random(1, 5) == 5 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back5Position)
					end
				end
			elseif itemEx.itemid == 8290 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
				if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
					setPlayerStorageValue(cid, 21545, 1)
					if math.random(1, 5) == 1 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back1Position)
					elseif math.random(1, 5) == 2 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back2Position)
					elseif math.random(1, 5) == 3 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back3Position)
					elseif math.random(1, 5) == 4 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back4Position)
					elseif math.random(1, 5) == 5 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back5Position)
					end
				end
			elseif itemEx.itemid == 8291 then
				setPlayerStorageValue(cid, itemEx.itemid, 1)
				if getPlayerStorageValue(cid, 8288) == 1 and getPlayerStorageValue(cid, 8289) == 1 and getPlayerStorageValue(cid, 8290) == 1 and getPlayerStorageValue(cid, 8291) == 1 then
					setPlayerStorageValue(cid, 21545, 1)
					if math.random(1, 5) == 1 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back1Position)
					elseif math.random(1, 5) == 2 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back2Position)
					elseif math.random(1, 5) == 3 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back3Position)
					elseif math.random(1, 5) == 4 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back4Position)
					elseif math.random(1, 5) == 5 then
						doSendMagicEffect(fromPosition, 10)
						doTeleportThing(cid,back5Position)
					end
				end
			end
		elseif math.random(1, 2) == 2 then
			doSendMagicEffect(toPosition, 0)
			doTargetCombatHealth(0, cid, COMBAT_EARTHDAMAGE, -500, -700, CONST_ME_BIGPLANTS)
		end
	else
	doSendMagicEffect(toPosition, 2)
	end
end
return TRUE
end


LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)

   	if item.uid == 12901 then
   		queststatus = getPlayerStorageValue(cid,50090)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found demon legs.")
   			doPlayerAddItem(cid,2495,1)
   			setPlayerStorageValue(cid,50090,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
   		end
   	elseif item.uid == 12902 then
   		queststatus = getPlayerStorageValue(cid,50090)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a rainbow shield.")
   			doPlayerAddItem(cid,8905,1)
   			setPlayerStorageValue(cid,50090,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
   		end
   	elseif item.uid == 12904 then
   		queststatus = getPlayerStorageValue(cid,50090)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a royal crossbow.")
   			doPlayerAddItem(cid,8851,1)
   			setPlayerStorageValue(cid,50090,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
		end
   	elseif item.uid == 12903 then
   		queststatus = getPlayerStorageValue(cid,50090)
   		if queststatus == -1 then
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "You have found a Spellbook of Dark Mysteries.")
   			doPlayerAddItem(cid,8918,1)
   			setPlayerStorageValue(cid,50090,1)
   		else
   			doPlayerSendTextMessage(cid,MESSAGE_INFO_DESCR, "It is empty.")
   		end
	end
   	return 1
end

LUA:
function onUse(cid, item, fromPosition, itemEx, toPosition)
local position = {x=32786, y=32412, z=8}
        if getPlayerStorageValue(cid, 21545) > 1 then
                doTeleportThing(cid, position)
                doSendMagicEffect(position, CONST_ME_TELEPORT)
        else
                return false
        end
        return true
end

movements...

LUA:
<movevent event="StepIn" actionid="32193" script="demonoak entrance.lua"/>
	<movevent event="StepIn" actionid="32194" script="demonoak entrance.lua"/>


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

--Config-->
local starting = {x = 32705, y = 32346, z = 7, stackpos = 253}
local ending = {x = 32729, y = 32360, z = 7, stackpos = 253}
local checking = {x = starting.x, y = starting.y, z = starting.z, stackpos = starting.stackpos}
local portal_in_pos = {x = 32716, y = 32345, z = 7, stackpos = 1}
local portal_iten_pos = getThingfromPos(portal_in_pos)
local teleportId = 8292
local player_pos_pradedam = {x = 32716, y = 32347, z = 7} --iejimas i kambari
local player_pos_baigiam = {x = 32715, y = 32347, z = 7}
local boss_pos = {x = 32713, y = 32348, z = 7}
local boss = "Rat"
local queststatus = getPlayerStorageValue(cid, 21545) -- storage naudojam
--EndConfig-->

--Do not touch this--
if getPlayerLookDir(cid) == 0 then
newdir = 2
elseif getPlayerLookDir(cid) == 1 then
newdir = 3
elseif getPlayerLookDir(cid) == 2 then
newdir = 0
else
newdir = 1
end
--Don't edit this unless you know what you are doing.

if item.actionid == 32193 then
doSendMagicEffect(player_pos_baigiam, 10)
doRemoveItem(portal_iten_pos.uid, 1)
return TRUE
end

if item.actionid == 32194 and queststatus == -1 then
players = 0
totalmonsters = 0
monster = {}
repeat
creature = getThingfromPos(checking)
if creature.itemid > 0 then

if getPlayerAccess(creature.uid) == 0 then
players = players + 1
end

if getPlayerAccess(creature.uid) ~= 0 and getPlayerAccess(creature.uid) ~= 3 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

if players == 0 then

if totalmonsters ~= 0 then
current = 0
repeat
current = current + 1


until current >= totalmonsters	
end 

doTeleportThing(cid, player_pos_pradedam)
doSendMagicEffect(player_pos_pradedam, 10)


if portal_iten_pos.itemid == teleportId then
doRemoveItem(portal_iten_pos.uid, 1)
end 

else
doMoveCreature(cid, newdir)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'is in the room now. Wait a moment!')
end
else
doMoveCreature(cid, newdir)
doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_ORANGE, 'Sorry you already did this quest!')
end
end




if you wanna other script just tell me i have everything i'm in think so, but however i wont release my full data-pack.
 
Last edited:
Small easy things...

to play cultpiano and hunt cults

LUA:
<action uniqueid="6092" script="other/cultchest.lua"/> 
<action uniqueid="60034" script="other/cultpiano.lua"/> 
	<action itemid="6087" script="other/cultpiano.lua"/>
	<action itemid="6088" script="other/cultpiano.lua"/>
	<action itemid="6089" script="other/cultpiano.lua"/>
	<action itemid="6090" script="other/cultpiano.lua"/>

LUA:
local VERSE = {6087, 6088, 6089, 6090}

function onUse(cid, item, frompos, item2, topos)

local queststatus = getPlayerStorageValue(cid,item.itemid)
local versestatus1 = getPlayerStorageValue(cid, 6087)
local versestatus2 = getPlayerStorageValue(cid, 6088)
local versestatus3 = getPlayerStorageValue(cid, 6089)
local versestatus4 = getPlayerStorageValue(cid, 6090)
local npos = {x=topos.x-3, y=topos.y, z=topos.z}

if item.uid == 60034 then
	if versestatus1 == 1 and versestatus2 == 1 and versestatus3 == 1 and versestatus4 == 1 then
		doSendMagicEffect(topos, 18)
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have successfully played the song.")
		doTeleportThing(cid, npos, FALSE)
	else
		 doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You dont know the complete song.")
	end
elseif item.uid == 6087 or 6088 or 6089 or 6090 then
	if queststatus ~= 1 then
		doSendMagicEffect(frompos, 18)
		doRemoveItem(item.uid,1)
		setPlayerStorageValue(cid,item.itemid,1)				
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have successfully learnt new hymne verse.")	
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You already know this verse.")
	end
end
return TRUE
end

LUA:
function onUse(cid, item, frompos, item2, topos)

if item.uid == 6092 then
queststatus = getPlayerStorageValue(cid,6092)
if queststatus == -1 then
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"You have found Elane's crossbow.")
doPlayerAddItem(cid,5947,1)
setPlayerStorageValue(cid,6092,1)
else
doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"It is empty.")
end
else
return FALSE
end

return TRUE
end


make a lotto without spam on ground floor.

LUA:
<action itemid="5957" script="other/lotto.lua"/>
LUA:
function onUse(cid, item, frompos, item2, topos)
	rand = math.random(1,120)

if item.itemid == 5957 then
	if rand == 7 then
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"WINNER, Congratulations you draw a winner lottery ticket!")
		doSendMagicEffect(frompos, 12) 
		doTransformItem(item.uid,item.itemid+1)
	else
		doPlayerSendTextMessage(cid, MESSAGE_INFO_DESCR,"Try again later, you draw blank.")
		doSendMagicEffect(frompos, 12)
		doTransformItem(item.uid,item.itemid-1)
		doPlayerRemoveItem(cid,5956,1)
	end 
	
    return
    end
end

LUA:
<action itemid="6558" script="other/demonic_blood.lua"/>
LUA:
local POTIONS = {7588, 7589}

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local rand = math.random(1, #POTIONS)
	doTransformItem(item.uid, POTIONS[rand])
	doSendMagicEffect(getThingPos(item.uid), CONST_ME_MAGIC_RED)
	return TRUE
end
 
Last edited:
Please make a new upload at rapidshare or 2shared.. Because in many pcs, LinkDSL net refusing to go on SPEDEYSHare!
 
Back
Top