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

Lightning Effect/Explosion Then Teleport

ArkSeyonet

Chancho
Joined
Nov 11, 2008
Messages
201
Reaction score
11
[FINAL UPDATE]

http://www.youtube.com/watch?v=DwalyoK91tk
^ IT IS NEW ^ HD

I have finished the script, and everything that I am going to show the public.
It IS different now, so don't feel like your going to watch the same thing. =]


Code:
--Player walks into portal after venturing through a deep and dark dungeon.
--Upon entering the portal, he appears at a beautiful garden. Everything is akward, but seems not very dangerous.
--As the player walks through the garden, the screen flashes a few times.
--When the player reaches the end of the garden, (basically when stepping on X tile) the screen flashes and suddenly there is a huge explosion.
--The player then notices a boss monster (not hostile yet, could make an npc to be honest, there are many ways to do this) has appeared, and is coming towards him.
--All of a sudden, another explosion, and the environment is trashed. (the player would be getting teleported to a new place that looks like the old one except destroyed and crap.
--The boss then appears(is spawned), and the fight begins.

It's all solved now. But feel free it look at the video and tell me what you think!
It's not finished, because the mapping is not done, but when I do finish, I will upload the final video.

But here:

<movements.xml>
Code:
<movevent type="StepIn" itemid="7066" event="script" value="LightningExplode.lua"/>

<LightningExplode.lua>
Code:
[COLOR="SeaGreen"]function onStepIn(cid, item, position, fromPosition, item2)
local storage = 35000
local teleportpos = {x = 119, y = 14, z = 14}
local p = getPlayerPosition(cid)[/COLOR]

[COLOR="RoyalBlue"]local positions = {
    { pos= {x=p.x+1,y=p.y,z=p.z}, delay = 100, delay2 = 4900, delay3 = 1520, delay4 = 2160, delay5 = 6505},
    { pos= {x=p.x+1,y=p.y+1,z=p.z}, delay = 200, delay2 = 5000, delay3 = 1600, delay4 = 2240, delay5 = 6505},
    { pos= {x=p.x,y=p.y+1,z=p.z}, delay = 300, delay2 = 5100, delay3 = 1680, delay4 = 2320, delay5 = 6505},
    { pos= {x=p.x-1,y=p.y+1,z=p.z}, delay = 400, delay2 = 5200, delay3 = 1760, delay4 = 2400, delay5 = 6505},
    { pos= {x=p.x-1,y=p.y,z=p.z}, delay = 500, delay2 = 5300, delay3 = 1840, delay4 = 2480, delay5 = 6505},
    { pos= {x=p.x-1,y=p.y-1,z=p.z}, delay = 600, delay2 = 5400, delay3 = 1920, delay4 = 2560, delay5 = 6505},
    { pos= {x=p.x,y=p.y-1,z=p.z}, delay = 700, delay2 = 5500, delay3 = 2000, delay4 = 2640, delay5 = 6505},
    { pos= {x=p.x+1,y=p.y-1,z=p.z}, delay = 800, delay2 = 5600, delay3 = 2080, delay4 = 2720, delay5 = 6505}
}[/COLOR]

[COLOR="Red"]    if(item.actionid == 5000) then
	doSendMagicEffect(p, 6)
        for i = 1, 8 do
	   addEvent(doSendMagicEffect, positions[i].delay, positions[i].pos, 6)
	   addEvent(doSendMagicEffect, positions[i].delay2, positions[i].pos, 6)
	   addEvent(doSendMagicEffect, positions[i].delay3, positions[i].pos, 6)
	   addEvent(doSendMagicEffect, positions[i].delay4, positions[i].pos, 6)
	   addEvent(doSendMagicEffect, positions[i].delay5, positions[i].pos, 6)
	   addEvent(doTeleportThing, 7250, cid, teleportpos)
	end
    elseif(item.actionid == 4999) then
		local lightLevel = 10
		local lightTicks = 1
		doSetCreatureLight(cid, lightLevel, 5, lightTicks)
    elseif(item.actionid == 4998) then
		local lightLevel = 8
		local lightTicks = 1
		doSetCreatureLight(cid, lightLevel, 65, lightTicks)
    end
return TRUE
end[/COLOR]

This is a shortened version of it.
My version has about 300-400 more lines.
Normally people wouldn't release their scripts, but I SUPPORT sharing information, because even though originality is one of the most important things when it comes to a new server, for a lot of people, I would like to help everyone learn more, and benefit with them, when they learn more, and release a script themselves. Of course not everyone will, but some will.
 
Last edited:
That is the right idea, but what it was, is not an effect, it was actually a white light that filled the game screen. As a flash of lightning would.
 
Code:
doSetCreatureLight(cid, lightLevel, lightColor, time)

Should work the only problem would be the client ambient light/light spells messing it up but you can only test and hope.

@edit
I was just thinking, it will work better below ground due to the lighting in caves (just a thought)
 
This existed a long time ago on a few 7.6 servers, I can't remember which tho, but i'm sure that the lightning effect is released on OTFans, it was a source edit.
The lightning flashed without any energy effects and so, i'm not sure how it worked.
 
@luvin
That is a good idea, it is at least worth a try to see what it does. Thanks for the input. =]

@alot of above :p
Not true, one of the old distrobutions of YurOTS(I think it was a custom one made by someone tho), or a server back in the day like that had this feature, that is what reminded me of it. At random intervals you would be walking and the client would flash white(only the game screen itself), it was configurable in config.lua ^^

@ Frag
yes you know what im takling about =]
 
Last edited:
Yea I think I remember what you mean now, was more of a "flicker" but ingame it looked like lightning xD really the only way u can do this is with light but as I said the ambient light really messes it up so the only way ur gonna be able to do it is to find a source edit.

P.S.
I turned my ambient light off for fun and made a lil test script that filled the client with 100% white light for 100ms and then set it back to black light... looks pretty fun xD


Edit: blue light looked kewler and here is a low-quality video of how it looks xD
http://www.youtube.com/watch?v=LI3_vbaXIak
 
Last edited:
yep :p that's right it only flickered solid white, but I mean it's Tibia, that's the closest to lightning you will get xD

EDIT:
@Luvin's Edit

Yeah, that does look pretty cool :O
 
Last edited:
Bump once. Just really wanna see if I can get any more replies on possible ways to create it. Wish I could get my hands on the old sources.
 
only way i know todo it is make an effect thats just like 9x9 of white, so when you fire the custom effect it would cover up the screen.
 
Alright this is what I ran into:

Code:
TILE_ACTION = 4999
TILE_GROUND = 405
function onStepIn(cid, item, position, fromPosition, item2)
local p = {cid = cid, position = position}
local position = getCreaturePosition(cid)
position.stackpos = 255

	if(item.actionid == TILE_ACTION and (item.itemid == TILE_GROUND) then
	local lightLevel = math.random(7, 10) 
	local lightTicks = 1
	local rand = math.random(1, 3)
		if rand == 1 then
			doSetCreatureLight(cid, lightLevel, 78, lightTicks)
		elseif rand == 2 then
			doSetCreatureLight(cid, lightLevel, 147, lightTicks)
		elseif rand == 3 then
			doSetCreatureLight(cid, lightLevel, 203, lightTicks)
		end
	return TRUE		
	end
end

What's wrong with it? I'm using 0.4 so... But it does the same on 0.3.6pl1.
It gives me stack traceback error.

errorhk.png
 
#up
luascript.cpp
Code:
	//doSetCreatureLight(cid, lightLevel, lightColor, time)
	lua_register(m_luaState, "doSetCreatureLight", LuaScriptInterface::luaDoSetCreatureLight);
and
Code:
int32_t LuaScriptInterface::luaDoSetCreatureLight(lua_State* L)
{
	//doSetCreatureLight(cid, lightLevel, lightColor, time)
	uint32_t time = popNumber(L);
	uint8_t color = (uint8_t)popNumber(L), level = (uint8_t)popNumber(L);

	ScriptEnviroment* env = getEnv();
	if(Creature* creature = env->getCreatureByUID(popNumber(L)))
	{
		Condition* condition = Condition::createCondition(CONDITIONID_COMBAT, CONDITION_LIGHT, time, level | (color << 8));
		creature->addCondition(condition);
		lua_pushboolean(L, true);
	}
	else
	{
		errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
		lua_pushboolean(L, false);
	}
	return 1;
}
luascript.h
Code:
		static int32_t luaDoSetCreatureLight(lua_State* L);
 
I will try it and edit this post later, thanks a lot. =]

It works. Only thing I had to change was

LuaScriptInterface

to

LuaInterface

:p
 
Last edited:
UPDATE:
UNTIL TOMORROW I WILL HAVE MY SERVER ONLINE, IF YOU WANT TO LOG ON AND LOOK AT IT YOURSELF

IP: omegarpg.servegame.com
Client: 8.54/8.55
Port: 7171

Just log in blank, but keep in mind you have a time limit, while logged into the Account Manager, so make your account, logout, log in, then make your character, or you will probably get kicked.

EDIT: Fixed hostname. You can log in again.

@Below:
It used to have that. I agree that this would be 100% better. But unless someone can source edit it back in, it's just not going to be available for us.
 
Last edited:
Back
Top