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

BombSquad [9.6]

sanderman14

New Member
Joined
May 2, 2009
Messages
20
Reaction score
0
Location
The Netherlands
This script is based on the idea of Third Aid
http://otland.net/f81/release-ultimate-bomb-60582/

Screenshots are in the original post (link above)

I didn't add any new functions, just rescripted the original script so it works with tibia 9.60
Tested with: The Forgotten Server v0.2.14 (Mystic Spirit)

ok, here we go with the new code:

Action Script:
actions/scripts/bombSquad.lua

Code:
-- Made by Third Aid
-- Edited by Xiduzo
function monsterSpawns()
	local monsters = {"Rat", "Rotworm", "Orc Leader", "Bog Raider", "Giant Spider", "Diabolic Imp", "Destroyer", "Dark Torturer", "Behemoth", "Hellspawn", "War Golem", "Serpent Spawn", "Hellhound", "Plaguesmith", 
					  "Demon", "Undead Dragon"} -- list of monster which should spawn (do not add extra monster / only change the names)
 
	local monstersPos = {x=308, y=274, z=7} -- Where the monsters should be spawned

 
	local northWestX = 304 -- North West X of the room with the bomb
	local northEastX = 319 -- North East X of the room with the bomb
	local northWestY = 270 -- North West Y of the room with the bomb
	local southWestY = 279 -- South West Y of the room with the bomb
	local roomFloor = 7 -- Floor / Z of the room with the bomb

	
	if getGlobalStorageValue(17000) == 1 then
		if getGlobalStorageValue(17001) <= 15 then
			setGlobalStorageValue(17001, getGlobalStorageValue(17001)+1)
			addEvent(monsterSpawns, 60*1000)
			for i = 1, 3 do -- summons 3 monsters
			doSummonCreature(monsters[getGlobalStorageValue(17001)], monstersPos)
			end
		else
			setGlobalStorageValue(17000, 0)
			setGlobalStorageValue(17001, 0)
			for x = northWestX, northEastX do
				for y = northWestY, southWestY do
				local explosionArea = {x=x, y=y, z=roomFloor, stackPos=253}
				local getCreatures = getTopCreature(explosionArea).uid
					doSendMagicEffect(explosionArea, CONST_ME_FIREATTACK)
					if(isCreature(getCreatures) == TRUE) then
						doCreatureAddHealth(getCreatures, -getCreatureHealth(getCreatures))
					end
				end
			end 
		end
	end
return true
end

local playerPosition = {
{x=293, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE}, -- The tiles they should stand on when pulling the switch
{x=294, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE},
{x=295, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE},
{x=296, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE}
}

local newPosition = {
{x=305, y=273, z=7}, -- Where they get teleported in the room with the bomb
{x=305, y=274, z=7},
{x=305, y=275, z=7},
{x=305, y=276, z=7}
}
 
local wallName = "Brick Wall" -- Name of the "Wall monster"
local wallPos = {x=319, y=275, z=7} -- Where the wall should be

-- do not edit below here!--
setGlobalStorageValue(17000,0)
setGlobalStorageValue(17002,0) 

function onUse(cid, item, fromPosition, itemEx, toPosition)
	local player = {}
	if item.itemid == 1945 then	
		setGlobalStorageValue(17002,0)	
		if getGlobalStorageValue(17000) == 0 then
			for i = 1, 4 do
				player[i] = getThingfromPos(playerPosition[i])
				if player[i].itemid > 0 then
					if isPlayer(player[i].uid) == true then
						if getPlayerLevel(player[i].uid) <= 99 then						
							doPlayerSendCancel(cid, "All players need to be level 100 or higher.")
						else	
							setGlobalStorageValue(17002, getGlobalStorageValue(17002)+1)
							if getGlobalStorageValue(17002) == 4 then
								for i = 1, 4 do
								doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
								doTeleportThing(player[i].uid, newPosition[i], FALSE)
								doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)
								end
								addEvent(monsterSpawns, 30*1000)
								doSummonCreature(wallName, wallPos)
								doTransformItem(item.uid, item.itemid + 1)
								setGlobalStorageValue(17001, 0)
								setGlobalStorageValue(17000, 1)
							else
								doPlayerSendCancel(cid, "You need 4 people to start this quest.")
							end							
						end
					end
				end
			end
		elseif getGlobalStorageValue(17000) == 1 then
			doPlayerSendCancel(cid, "There is allready a team inside, please be patient.")
		end		
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, item.itemid - 1)
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
return true
end

actions/actions.xml
PHP:
<action actionid="17000" event="script" value="bombQuest/bombSquad.lua"/>

Movement Script:
movements/scripts/bombSquad.lua
Code:
function onStepIn(cid, item, position, fromPosition)
	doSendMagicEffect(getCreaturePosition(cid), CONST_ME_TELEPORT)
	doSendMagicEffect(fromPosition, CONST_ME_POFF)
return true
end

movements/movements.xml
PHP:
<movevent type="StepIn" actionid="17001" event="script" value="bombSquad.lua"/>

monsters/misc/Brick Wall.xml
PHP:
<?xml version="1.0" encoding="UTF-8"?>
<monster name="Brick Wall" nameDescription="a brick wall" race="blood" experience="500000" speed="0" manacost="200">
    <health now="540000" max="540000"/>
    <look typeex="1025"/>
    <targetchange interval="2000" chance="0"/>
    <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="0"/>
        <flag canpushcreatures="0"/>
        <flag targetdistance="1"/>
        <flag staticattack="90"/>
        <flag runonhealth="0"/>
    </flags>
    <attacks>
        <attack name="melee" interval="2000" skill="0" attack="0">
        </attack>
    </attacks>
    <defenses armor="1" defense="5"/>
    <loot>
    </loot>
</monster>

monsters/monsters.xml
PHP:
<monster name="Brick Wall" file="Misc/Brick Wall.xml"/>

- didnt add the bomb changer and text sender yet but i maybe will add that later or somebody else will

Xiduzo
 
v1.1

Added that the bomb will change itemid and change back when the room restarts

In actions / scripts / bombSuad.lua,

remove the code above and copy/paste the code from below:

PHP:
-- Made by Third Aid
-- Edited by Xiduzo
function monsterSpawns()
	local monsters = {"Rat", "Rotworm", "Orc Leader", "Bog Raider", "Giant Spider", "Diabolic Imp", "Destroyer", "Dark Torturer", "Behemoth", "Hellspawn", "War Golem", "Serpent Spawn", "Hellhound", "Plaguesmith", 
					  "Demon", "Undead Dragon"} -- list of monster which should spawn (do not add extra monster / only change the names)
 
	local monstersPos = {x=308, y=274, z=7} -- Where the monsters should be spawned
	local bombPos = {x=311, y=274, z=7} -- bombpos
	local getBomb = getThingfromPos(bombPos)

 
	local northWestX = 304 -- North West X of the room with the bomb
	local northEastX = 319 -- North East X of the room with the bomb
	local northWestY = 270 -- North West Y of the room with the bomb
	local southWestY = 279 -- South West Y of the room with the bomb
	local roomFloor = 7 -- Floor / Z of the room with the bomb
	
	if getGlobalStorageValue(17000) == 1 then
		if getGlobalStorageValue(17001) <= 15 then
			setGlobalStorageValue(17001, getGlobalStorageValue(17001)+1)
			addEvent(monsterSpawns, 60*1000)
			for i = 1, 3 do -- summons 3 monsters
			doSummonCreature(monsters[getGlobalStorageValue(17001)], monstersPos)
			end
		else
			setGlobalStorageValue(17000, 0)
			setGlobalStorageValue(17001, 0)
			doRemoveItem(getBomb.uid,1)
			doCreateItem(9891,1,bombPos)
			for x = northWestX, northEastX do
				for y = northWestY, southWestY do
				local explosionArea = {x=x, y=y, z=roomFloor, stackPos=253}
				local getCreatures = getTopCreature(explosionArea).uid
					doSendMagicEffect(explosionArea, CONST_ME_FIREATTACK)
					if(isCreature(getCreatures) == TRUE) then
						doCreatureAddHealth(getCreatures, -getCreatureHealth(getCreatures))
					end
				end
			end 
		end
	end
return true
end

local playerPosition = {
{x=293, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE}, -- The tiles they should stand on when pulling the switch
{x=294, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE},
{x=295, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE},
{x=296, y=275, z=7, stackpos=STACKPOS_TOP_CREATURE}
}

local newPosition = {
{x=305, y=273, z=7}, -- Where they get teleported in the room with the bomb
{x=305, y=274, z=7},
{x=305, y=275, z=7},
{x=305, y=276, z=7}
}
 
local wallName = "Brick Wall" -- Name of the "Wall monster"
local wallPos = {x=319, y=275, z=7} -- Where the wall should be


-- do not edit below here!--
setGlobalStorageValue(17000,0)
setGlobalStorageValue(17002,0) 

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

	local bombPos = {x=311, y=274, z=7} -- bombpos
	local getBomb = getThingfromPos(bombPos)
	
	local player = {}	
	if item.itemid == 1945 then	
		setGlobalStorageValue(17002,0)	
		if getGlobalStorageValue(17000) == 0 then
			for i = 1, 4 do
				player[i] = getThingfromPos(playerPosition[i])
				if player[i].itemid > 0 then
					if isPlayer(player[i].uid) == true then
						if getPlayerLevel(player[i].uid) <= 99 then						
							doPlayerSendCancel(cid, "All players need to be level 100 or higher.")
						else	
							setGlobalStorageValue(17002, getGlobalStorageValue(17002)+1)
							if getGlobalStorageValue(17002) == 4 then
								for i = 1, 4 do
								doSendMagicEffect(playerPosition[i], CONST_ME_POFF)
								doTeleportThing(player[i].uid, newPosition[i], FALSE)
								doSendMagicEffect(newPosition[i], CONST_ME_ENERGYAREA)								
								end
								doCreatureSay(cid, 'The bomb will start ticking in 30 seconds, each minute 3 monsters will spawn, escape before the bomb explodes.', TALKTYPE_ORANGE_1)
								doRemoveItem(getBomb.uid,1)
								doCreateItem(9890,1,bombPos)
								addEvent(monsterSpawns, 30*1000)
								doSummonCreature(wallName, wallPos)
								doTransformItem(item.uid, item.itemid + 1)
								setGlobalStorageValue(17001, 0)
								setGlobalStorageValue(17000, 1)
							else
								doPlayerSendCancel(cid, "You need 4 people to start this quest.")
							end							
						end
					end
				end
			end
		elseif getGlobalStorageValue(17000) == 1 then
			doPlayerSendCancel(cid, "There is allready a team inside, please be patient.")
		end		
	elseif item.itemid == 1946 then
		doTransformItem(item.uid, item.itemid - 1)
		doPlayerSendCancel(cid, "Sorry, not possible.")
	end
return true
end
 
Back
Top