Labyrinth Obelisks

Share files with other Dawn of Light users

Moderator: Support Team

Labyrinth Obelisks

Postby Fulmine » Sun Feb 05, 2017 2:04 am

There is an old code from few years ago of Labyrinth Obelisks.
The code create automatically all obelisks in the labyrinth, it's working like on official server, but I didn't implement the anti-camp system for now. Maybe one day... or feel free to edit.
Attachments
Myrddin - Labyrinth Obelisks.zip
Myrddin - Labyrinth Obelisks
(27.98 KiB) Downloaded 206 times
Fulmine
DOL Acolyte
 
Posts: 116
Joined: Thu Mar 22, 2007 5:37 pm

Re: Labyrinth Obelisks

Postby Leodagan » Sun Feb 05, 2017 10:14 am

Hello Fulmine,

Would you mind explaining the game mechanisms of official server's Obelisks ?

I never played Laby on Live and I'm curious if I can bring this script to DOL with missing anti-camp implementation... (It's pretty hard to find knowledge about DAOC features in 2017...)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Labyrinth Obelisks

Postby PlanarChaosRvrtwo » Sun Feb 05, 2017 11:04 am

The stones work this way you run into laby and need activate obelisk by click it by that you can click any obelisk and activated obelisks show white name of other obelisks and you can click em to port that loc others appear grey till you activated em by clicking em
DOL dint only gaved me the data to start my server,
it also gaved me 16 amazing years with nice peeps,
and now its on me to return the favor.
User avatar
PlanarChaosRvrtwo
Database Team
 
Posts: 517
Joined: Thu Jul 07, 2016 6:21 am

Re: Labyrinth Obelisks

Postby HunabKu » Sun Feb 05, 2017 11:39 am

Memories ^^
I fixed that after Myrddin closed, with character validation.
I don't know if i have it again.
"C'est l'ignorance qui apporte le chaos, pas la connaissance."
Scarlett Johansson dans "Lucy" de Luc Besson
-------------------------------------------------------------------------------
"Ignorance brings chaos, not knowledge."
Scarlett Johansson on "Lucy" by Luc Besson
User avatar
HunabKu
Developer
 
Posts: 1905
Joined: Sat Jun 18, 2011 4:48 am

Re: Labyrinth Obelisks

Postby Fulmine » Sun Feb 05, 2017 12:53 pm

PlanarChaosRvrtwo has pretty much explains everything. The anti-camp system prevents players to wait for others player by staying nearby of the obelisks, maybe a radius of 200 or 300. Don't remember well. About 5~10 secs a lightning strike the player doing some damage and repeat every 3 ~ seconds
Fulmine
DOL Acolyte
 
Posts: 116
Joined: Thu Mar 22, 2007 5:37 pm

Re: Labyrinth Obelisks

Postby PlanarChaosRvrtwo » Sun Feb 05, 2017 2:36 pm

The radius is 250
DOL dint only gaved me the data to start my server,
it also gaved me 16 amazing years with nice peeps,
and now its on me to return the favor.
User avatar
PlanarChaosRvrtwo
Database Team
 
Posts: 517
Joined: Thu Jul 07, 2016 6:21 am

Re: Labyrinth Obelisks

Postby Batlas » Thu Sep 14, 2017 12:21 am

I wanted to play around with this, and kind of have something if anyone is still interested.
Code: Select all
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

using DOL.Events;
using DOL.GS;
using DOL.GS.Effects;
using DOL.GS.Movement;
using DOL.GS.PacketHandler;
using DOL.GS.SkillHandler;
using DOL.GS.Keeps;
using DOL.Language;
using log4net;

namespace DOL.AI.Brain
{
public class GameObeliskBrain : StandardMobBrain
{

public List<GamePlayer> playersWarned = new List<GameLiving>();

public int attackTimerInterval = 3000;
public int attackDelayInterval = 30000;

protected Random m_random = new Random();

public GameObeliskBrain()
: base() {
m_aggroLevel = 0;
m_aggroMaxRange = 250;
}


public override int ThinkInterval {
get { return 3000; }
}

public override void Think() {


var currentPlayersSeen = new List<GamePlayer>();
foreach (GamePlayer player in Body.GetPlayersInRadius((ushort)AggroRange, true)) {

string obeliskWarning = "The air is thick with currents of elemental energy flowing from the nexus rift at the base of the Obelisk. ";
obeliskWarning += "This area is not safe to linger in.";
player.Out.SendMessage(obeliskWarning, eChatType.CT_Say, eChatLoc.CL_ChatWindow);

if (!playersWarned.Contains(player)) {
playersWarned.Add(player);
attackTimer = new RegionTimer(Body, new RegionTimerCallback(obeliskAttackTimerCallback), attackDelayInterval);
attackTimer.Properties.setProperty("gamePlayer",player);
}



currentPlayersSeen.Add(player);

for (int i=0; i<playersWarned.Count; i++)
{
if (!currentPlayersSeen.Contains(playersWarned[i])){
playersWarned.RemoveAt(i);
}
}
}

return;
}

public function obeliskAttackTimerCallback(RegionTimer callingTimer){

GamePlayer player = callingTimer.Properties.getProperty("gamePlayer");
if (player && playersWarned.Contains(player)){
int damage = m_random.Next(120,170);

string obeliskDamage = "Lightning strikes you from the ceiling! It flows into the nexus rift at the base of the Obelisk of Nurizane.";
obeliskDamage += "You should leave the area immediately if you wish to avoid further damage.";

string damageMessage = "The nexus rift lighting hits you for "+damage+" damage.";
player.Out.SendMessage(damageMessage, eChatType.CT_YouWereHit, eChatLoc.CL_ChatWindow);
player.ChangeHealth(player,ChangeHealth.Unknown,damage);
attackTimer = new RegionTimer(Body, new RegionTimerCallback(obeliskAttackTimerCallback), attackTimerInterval);
attackTimer.Properties.setProperty("gamePlayer",player);
}
}
}
}
Things to note:

Does not check for pets, I didn't feel like writing the logic for that, but it would be pretty easy to implement.

It doesn't actually handle the "attack". I would assume that the way live handles it is having an invisible mob named nexus rift lighting that has the same radius (250), and then you get manually added to it's aggrotable when you reach 30 seconds.

There is no spell animation. I thought about writing a db insert for it, but since I'm not actually "attacking" the player, I skipped it.

I haven't actually tested the code. I don't have a DOL environment up, I was browsing the forums and saw this and it interested me.

To test it, just set the mob brain to GameObeliskBrain and go from there.
[22:29] <Arms> someones having sex upstairs -.-
[22:30] <Arms> bbl

[21:16] <Angie> do /me
[21:16] <Batlas> roflmao
[21:16] <Dalaaji> haha
[21:16] <Batlas> wow that came out bad
[21:16] <Angie> wow
[21:16] <Angie> that so came out bad
Batlas
Support Team
 
Posts: 1707
Joined: Sun Mar 21, 2004 3:11 am

Re: Labyrinth Obelisks

Postby Graveen » Thu Sep 14, 2017 11:15 pm

Hey my friend ! Ty for the code :)
Image
* pm me to contribute in Dawn of Light: code, database *
User avatar
Graveen
Project Leader
 
Posts: 12660
Joined: Fri Oct 19, 2007 9:22 pm
Location: France

Re: Labyrinth Obelisks

Postby Batlas » Fri Sep 15, 2017 12:37 am

I told you I got the bug. I may go back and rewrite it to work properly. I think the brain can be easily modified to work on the invisible mob that does the casting. The only change is adding/removing to the aggro table and giving the mob a 3 second lighting/smite spell.

Also, new necros seem pretty cool. Once I understand it more, maybe I can pick that up as a pet project.
[22:29] <Arms> someones having sex upstairs -.-
[22:30] <Arms> bbl

[21:16] <Angie> do /me
[21:16] <Batlas> roflmao
[21:16] <Dalaaji> haha
[21:16] <Batlas> wow that came out bad
[21:16] <Angie> wow
[21:16] <Angie> that so came out bad
Batlas
Support Team
 
Posts: 1707
Joined: Sun Mar 21, 2004 3:11 am

Re: Labyrinth Obelisks

Postby Batlas » Fri Sep 15, 2017 7:02 pm

I thought about my earlier statement, and the way it works right now may be the best way to handle it atm. Adding multiple players to a mobs aggro table, it will only attack 1 player. There are some weird work arounds for that, but I'm not sure what would be the best way of handling it. Spawn in a new mob for every player?
[22:29] <Arms> someones having sex upstairs -.-
[22:30] <Arms> bbl

[21:16] <Angie> do /me
[21:16] <Batlas> roflmao
[21:16] <Dalaaji> haha
[21:16] <Batlas> wow that came out bad
[21:16] <Angie> wow
[21:16] <Angie> that so came out bad
Batlas
Support Team
 
Posts: 1707
Joined: Sun Mar 21, 2004 3:11 am

Re: Labyrinth Obelisks

Postby Batlas » Sun Sep 17, 2017 7:56 pm

Code: Select all
/*
* DAWN OF LIGHT - The first free open source DAoC server emulator
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Reflection;

using DOL.Events;
using DOL.GS;
using DOL.GS.Effects;
using DOL.GS.Movement;
using DOL.GS.PacketHandler;
using DOL.GS.SkillHandler;
using DOL.GS.Keeps;
using DOL.Language;
using log4net;

namespace DOL.AI.Brain
{
public class GameObeliskBrain : StandardMobBrain
{

public List<GamePlayer> playersWarned = new List<GamePlayer>();

public int attackTimerInterval = 3000;
public int attackDelayInterval = 30000;

protected Random m_random = new Random();

public GameObeliskBrain()
: base() {
m_aggroLevel = 0;
m_aggroMaxRange = 250;
}


public override int ThinkInterval {
get { return 3000; }
}

public override void Think() {


var currentPlayersSeen = new List<GamePlayer>();
foreach (GamePlayer player in Body.GetPlayersInRadius((ushort)AggroRange, true)) {

string obeliskWarning = "The air is thick with currents of elemental energy flowing from the nexus rift at the base of the Obelisk. ";
obeliskWarning += "This area is not safe to linger in.";
player.Out.SendMessage(obeliskWarning, eChatType.CT_Say, eChatLoc.CL_ChatWindow);

if (!playersWarned.Contains(player)) {
playersWarned.Add(player);
RegionTimer attackTimer = new RegionTimer(Body, new RegionTimerCallback(obeliskAttackTimerCallback), attackDelayInterval);
attackTimer.Properties.setProperty("gamePlayer",player);
}



currentPlayersSeen.Add(player);

for (int i=0; i<playersWarned.Count; i++)
{
if (!currentPlayersSeen.Contains(playersWarned[i])){
playersWarned.RemoveAt(i);
}
}
}

return;
}

public virtual int obeliskAttackTimerCallback(RegionTimer callingTimer){

GamePlayer player = callingTimer.Properties.getProperty<object>("gamePlayer", null) as GamePlayer;
if (player != null && playersWarned.Contains(player)){
int damage = m_random.Next(120,170);

string obeliskDamage = "Lightning strikes you from the ceiling! It flows into the nexus rift at the base of the Obelisk of Nurizane.";
obeliskDamage += "You should leave the area immediately if you wish to avoid further damage.";

string damageMessage = "The nexus rift lighting hits you for "+damage+" damage.";
player.Out.SendMessage(damageMessage, eChatType.CT_YouWereHit, eChatLoc.CL_ChatWindow);
player.ChangeHealth(player,DOL.GS.GameLiving.eHealthChangeType.Unknown,damage);
RegionTimer attackTimer = new RegionTimer(Body, new RegionTimerCallback(obeliskAttackTimerCallback), attackTimerInterval);
attackTimer.Properties.setProperty("gamePlayer",player);
}

return 0;
}
}
}
Now that I have #dev, I took some time and decided to test this out. There were tons of errors I needed to work through to get this to compile. I have attached the modified version. (I definitely wrote this as if it were a php class originally... lol)
[22:29] <Arms> someones having sex upstairs -.-
[22:30] <Arms> bbl

[21:16] <Angie> do /me
[21:16] <Batlas> roflmao
[21:16] <Dalaaji> haha
[21:16] <Batlas> wow that came out bad
[21:16] <Angie> wow
[21:16] <Angie> that so came out bad
Batlas
Support Team
 
Posts: 1707
Joined: Sun Mar 21, 2004 3:11 am


Return to “%s” User Files

Who is online

Users browsing this forum: No registered users and 1 guest