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

TalkAction pits of hell event

gigastar

Member
Joined
Jan 25, 2009
Messages
252
Reaction score
15
Event based on players trying to get through a small isle possible 2-3sqm, the players try to run though without getting hit by the fire. If they get hit, back to restart.

(creates dead bodys, and cleans.)

Players dont acually die, just teleported back.

Talkaction:

Code:
<talkaction words="!pits of hell;/pits of hell;/close" event="script" value="pits of hell.lua"/>

Lua:
local pitPosition = {x = 1000, y = 1000, z = 7}

function onSay(cid, words, param, channel)
if (param == "") or (param == nil) then
	doPlayerSendCancel(cid, "Command param required.")
	return false
end

if (param == "!pit of hell") then
	doTeleportThing(cid, pitPosition)
	doPlayerPopupFYI(cid, "Welcome to the pits of hell!")
end


if (not getPlayerAccess(cid) >= access_to_use) then
		doPlayerSendCancel(cid, "You cannot use this command.")
	return false
end

if (param == "/pit of hell") then
	setGlobalStorageValue(pit_of_hell, 1)
		doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have started pits of hell.")
			doBroacastMessage("The firey pits of hell are open! Get there fast!", 1)
end

if (param == "/close") then
	if getGlobalStorageValue(pit_of_hell) == 1 then
		setGlobalStorageValue(pit_of_hell, 0)
			doPlayerSendTextMessage(cid, MESSAGE_STATUS_CONSOLE_RED, "You have close pits of hell.")
				doBroacastMessage("The firey pits of hell are closed! May your souls rest in peace.", 1)
	else
		doPlayerSendCancel(cid, "The pits of hell are not open.")
		return false
	end
end
return true
end

GlobalEvent: Assuming 2000 is 2 seconds.
if you want them to spawn faster add more doCreateItem(math.random(positions), evil_fire)

Code:
<globalevent name="pit of hell" interval="2000" event="script" value="pits of hell.lua"/>

Lua:
local positions = {
[1] = {x = 1000, y = 1000, z = 7},
[2] = {x = 1000, y = 1000, z = 7},
[3] = {x = 1000, y = 1000, z = 7},
[4] = {x = 1000, y = 1000, z = 7},
[5] = {x = 1000, y = 1000, z = 7},
[6] = {x = 1000, y = 1000, z = 7},
[7] = {x = 1000, y = 1000, z = 7},
[8] = {x = 1000, y = 1000, z = 7},
[9] = {x = 1000, y = 1000, z = 7},
[10] = {x = 1000, y = 1000, z = 7}
}

local evil_fire = 1111 --Item to kill them if they walk in it--

function onThink(interval, lastExecution, thinkInterval)
if	(not getGlobalStorageValue(pit_of_hell) == 1 then
return false
end

if getGlobalStorageValue(pit_of_hell) == 1 then
	doCreateItem(math.random(positions), evil_fire)
	doRemoveItem(positions, evil_fire)
if isCorpse(positions) then
	doRemoveItem(item.itemid)
end
end
end
end

MoveEvents:

Code:
<movevent type="StepIn" itemid="evil_fire_id" event="script" value="pits of hell.lua"/>
<movevent type="StepOut" itemid="evil_fire_id" event="script" value="pits of hell.lua"/>

Lua:
local eventpos = {
[1] = {x = 1000, y = 1000, z = 7},
[2] = {x = 1000, y = 1000, z = 7},       -- This is so you can make players teleport to more then one place (help player stack lag) --
[3] = {x = 1000, y = 1000, z = 7},
[4] = {x = 1000, y = 1000, z = 7}
}

local evil_fire = 1111

function onStepIn(cid, item, position, fromPosition)
if getGlobalStorageValue(pit_of_hell) == 1 then
	if item.itemid == evil_fire then
		doCreateItem(getPlayerPosition(cid), 2317)
		doTeleportThing(cid, math.random(eventpos))
end
end
end
		
function onStepOut(cid, item, position, fromPosition)
if getGlobalStorageValue(pit_of_hell) == 1 then
	if item.itemid == evil_fire then
		doCreateItem(getPlayerPosition(cid), 2317)
		doTeleportThing(cid, math.random(eventpos))
end
end
end

- - - Updated - - -

Imagine a system thats not free.....
 
Thanks for this relase!
But why not automatic, you will have to open it every time you whant to start the event...

- - - Updated - - -

You can't put pics? And a little bit more of explanation it's not bad!
 
Add another global event

Lua:
local timeend = 2 -- time in minutes to end event --

function onThink(interval, lastExecution, thinkInterval)
if getGlobalStorageValue(pits_of_hell) == 0 then
  setGlobalStorageValue(pits_of_hell, 1)
doBroadcastMessage("PITS OF HELL HAS STARTED!", 1)
  addEvent(endEvent, 60 * 1000 * timeend)
end
end

local function endEvent
if getGlobalStorageValue(pits_of_hell) == 1 then
  setGlobalStorageValue(pits_of_hell, 0)
doBroadcastMessage("PITS OF HELL HAS ENDED!", 1)
end

set intravel in the XML to how ever long you want it to start.

so if you wanted every 30 mins it will open, set to 30 mins...

- - - Updated - - -

Here a pic of set up, for each fire you must add it in the positions.

http://imageshack.us/photo/my-images/11/showqq.jpg/

- - - Updated - - -

Explanation:

In the global event. If you want more then 1 fire to spawn every 2 seconds (unless you set intraval less)
Then add more
doCreateItem(math.random(positions), evil_fire) under the one that is in there.

If you have 2 that means 2 fires will spawn in the area of the event every 2 seconds... if you have

doCreateItem(math.random(positions), evil_fire)
doCreateItem(math.random(positions), evil_fire)
doCreateItem(math.random(positions), evil_fire)

thats 3 fires every 2 seconds somehwere in the event area.

If you want the script to work, you have to put every position you want a fire to spawn in
Right now there is 10 spots, therefor the event area will be 10SQMs.

2sqm by 5 sqm (its not long but thats why its a configurable scripts.) You just add more

[11] = {x = 1000, y = 1000, z = 1000},
[12] = {x = 1000, y = 1000, z = 1000} and so on... just remember the last position doesnt have a comma at end.
 
Last edited:
Back
Top