Guard Speed![SOLVED]

For any problems with Dawn of Light website or game server, please direct questions and problems here.

Moderator: Support Team

Guard Speed![SOLVED]

Postby Loki » Thu Dec 01, 2016 2:49 pm

Code: Select all
public static void SetGuardSpeed(GameKeepGuard guard) { if (guard.IsPortalKeepGuard) { guard.MaxSpeedBase = 575; } if ((guard is GuardLord && guard.Component != null) || guard is GuardStaticArcher || guard is GuardStaticCaster) { guard.MaxSpeedBase = 0; } else if (guard.Level < 250) { if (guard.Realm == eRealm.None) { guard.MaxSpeedBase = 200; } else if (guard.Level < 50) { guard.MaxSpeedBase = 210; } else { guard.MaxSpeedBase = 250; } } else { guard.MaxSpeedBase = 575; } }

In my mob table the speed for a gaurd is 0, but they are still moving

I thought this should prevent that. Am I missing something else.
Code: Select all
if ((guard is GuardLord && guard.Component != null) || guard is GuardStaticArcher || guard is GuardStaticCaster) { guard.MaxSpeedBase = 0; }

npctemplate is also 0.


Thank you
Last edited by Loki on Sun Dec 11, 2016 7:45 pm, edited 1 time in total.
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: Guard Speed!

Postby HunabKu » Thu Dec 01, 2016 3:37 pm

Hi, did you try to modify MaxBaseSpeed directly on the guard AddToWorld Method ?
"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: Guard Speed!

Postby Graveen » Thu Dec 01, 2016 8:22 pm

The speed in your table is overriden by theses setting. A lord, mage, archer guard will never move (just shoot). Any other guard will have its own speed modifyed.

Proper way should be a different class for each type, each class inheriting from a base one. The if/if/if sequence is not very good :(
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: Guard Speed!

Postby Loki » Sun Dec 04, 2016 5:48 pm

In the command keepguard create
Code: Select all
case "caster": { if (args.Length > 3) guard = new GuardStaticCaster(); else guard = new GuardCaster(); break; }
But in TemplateManager
Code: Select all
if ((guard is GuardLord && guard.Component != null) || guard is GuardStaticArcher || guard is GuardStaticCaster) { guard.MaxSpeedBase = 0; }
Should the TemplateManager also include
Code: Select all
if ((guard is GuardLord && guard.Component != null) || guard is GuardStaticArcher || guard is GuardStaticCaster ||guard is GuardCaster || guard is GuardArcher) { guard.MaxSpeedBase = 0; }
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: Guard Speed!

Postby Loki » Sun Dec 04, 2016 5:57 pm

I guess Ill see what happens eh :-)
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: Guard Speed!

Postby Loki » Sun Dec 04, 2016 7:01 pm

Well that works my casters are not moving now :-)

But I would love to know what issues this could cause if any
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: Guard Speed!

Postby Leodagan » Mon Dec 05, 2016 8:26 am

Why don't you use GuardStatic Variant if that's what you need ?

Subclass are meant for this, spawning similar NPC with only small attributes changes...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Guard Speed!

Postby Loki » Tue Dec 06, 2016 12:41 pm

Hi Leodagen, I noticed that whilst trying to resolve my problem. A Caster and Archer shouldn't move anyway I would have thought, maybe if in melee range they should but outside that?.

Why have Static and non Static variants ?

Thank you
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk

Re: Guard Speed!

Postby Leodagan » Wed Dec 07, 2016 5:51 am

If a Caster or Archer is part of a Guard Patrol they need to move...

Patrol are running around RvR Keep to engage realm enemies before they get near the doors ;)

If they are Keep or Tower Guard they need to be static, staying on rampart or elevated position only engaging realm enemies in range !

This prevent "pulling" all the Keep Guards through walls when attacking a structure ;)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: Guard Speed!

Postby Loki » Wed Dec 07, 2016 8:29 am

Of course..... how foolish of me to over look that.


Thank you
“ If debugging is the process of removing software bugs, then programming must be the process of putting them in. ”

Join https://discord.gg/r3T2U7S Official DOL Discord Chat
User avatar
Loki
Developer
 
Posts: 468
Joined: Fri Jun 23, 2006 2:14 am
Location: uk


Return to “%s” Support

Who is online

Users browsing this forum: No registered users and 1 guest