Go Back   EQEmulator Home > EQEmulator Forums > General > General::Server Discussion

General::Server Discussion Discussion about emulator servers.
Do not post support topics here.

Reply
 
Thread Tools Display Modes
  #16  
Old 05-24-2008, 05:04 PM
jenco420
Banned
 
Join Date: Jan 2006
Location: /dev/null
Posts: 99
Default

well fear is up and running on CKV_EQ if anyone wants to look at it.. The client side (i.e i get feared by naggy but nothing happens)is still not working but i'm sure one of us will figure it out eventually >.<

Maybe i'll just add back in the stun portion for PC fear /shrug
Reply With Quote
  #17  
Old 05-28-2008, 06:15 PM
Wiz
Dragon
 
Join Date: Feb 2002
Posts: 583
Default

Quote:
Originally Posted by Derision View Post
I never tested PVP fear, but I've looked at the code a bit more. There is some
code to disallow client-to-client fear, however with that commented out, you get
a message saying your are feared, but you actually aren't.

I'm speculating that that the server needs to send an OP_Fear packet to the
client to tell it it's feared, however I don't see such an opcode anywhere in
the source or .conf files.

Maybe if someone had a packet trace of a player being feared from back when the 6.2 client or Titanium where the live clients, that may help, or maybe it is not an opcode issue at all.
SOD has player fear, the packet is an apperancepacket that toggles "player loses control" on, but this is for an old client version, so I don't know if its applicable.

Code:
	void	LoseControl(bool interrupt_spells) { if (interrupt_spells) { InterruptSpell(); StopSong(); } Message_StringID(0,1461); SendAppearancePacket(14, 102); }
	void	RegainControl(bool interrupt_spells) { if (interrupt_spells) { InterruptSpell(); StopSong(); } SendAppearancePacket(14, 100); }
We've disabled the actual fear movement for the moment because its a lot more troublesome to keep players from going through walls than it is to do npcs, but if anyone wants to toy with it, it basically uses the same code with this movement function:

Code:
bool Client::FearMovement(float x, float y, float z)
{
	if (IsRooted() || Casting())
	{
        SetRunAnimSpeed(0);
        return true;
	}
	float nx = this->x_pos;
    float ny = this->y_pos;
    float nz = this->z_pos;
    float vx, vy, vz;
    float vb;
	float speed = 0.35f;
	float speed_mod = ((float)(speed*spellbonuses->movementspeed))/100.0f;
	speed += speed_mod;

	if (x_pos == x && y_pos == y)
	{
        SetRunAnimSpeed(0);
        return false;
	}

	bool ret = true;

	SetHeading(CalculateHeadingToTarget(x, y) * 8);

    // --------------------------------------------------------------------------
    // 1: get Vector AB (Vab = B-A)
    // --------------------------------------------------------------------------
    vx = x - nx;
    vy = y - ny;
    vz = z - nz;

	speed *= 30; //First we recalc into clientside units. 1.2 = 36, etc.
    SetRunAnimSpeed(speed);

	//Now we recalc it into units per second moved.
	speed *= 0.76;

	//Divide by ten to account for movement happening every 0.1
	speed /= 10;

    // --------------------------------------------------------------------------
    // 2: get unit vector
    // --------------------------------------------------------------------------
    vb = speed / sqrt (vx*vx + vy*vy);

    if (vb >= 0.5) //Stop before we've reached the point in case it's too close to a wall
    {
		/*
		x_pos = x;
        y_pos = y;
		if (zone->map == 0)
		{
			z_pos = z;
		}
		else
		{
			NodeRef pnode = zone->map->SeekNode( zone->map->GetRoot(), x_pos, y_pos );
			if (pnode == NODE_NONE)
			{
				z_pos = z;
			}
			else
			{
				VERTEX me;
				me.x = x_pos;
				me.y = y_pos;
				me.z = z + GetHeight();
				VERTEX hit;
				FACE *onhit;
				float best_z = zone->map->FindBestZ(pnode, me, &hit, &onhit);
				if (best_z != -999999 && fdiff(best_z,GetZ())<=12.0)
				{
					z_pos = best_z + 1;
				}
				else
				{
					z_pos = z;
				}
			}
		}
		*/
		fear_walkto_x = x_pos;
		fear_walkto_y = y_pos;
		fear_walkto_z = z_pos;
		ret = false;
    }
    else
    {
        // --------------------------------------------------------------------------
        // 3: destination = start plus movementvector (unitvektor*speed)
        // --------------------------------------------------------------------------
        x_pos = x_pos + vx*vb;
        y_pos = y_pos + vy*vb;
		if (zone->map == 0)
		{
			z_pos = z_pos + vz*vb;
		}
		else
		{
			NodeRef pnode = zone->map->SeekNode( zone->map->GetRoot(), x_pos, y_pos );
			if (pnode == NODE_NONE)
			{
				z_pos = z_pos + vz*vb;
			}
			else
			{
				VERTEX me;
				me.x = x_pos;
				me.y = y_pos;
				me.z = z_pos + vz*vb + GetHeight();
				VERTEX hit;
				FACE *onhit;
				float best_z = zone->map->FindBestZ(pnode, me, &hit, &onhit);
				if (best_z != -999999 && fdiff(best_z,GetZ())<=12.0)
				{
					z_pos = best_z + 1;
				}
				else
				{
					z_pos = z_pos + vz*vb;
				}
			}
		}
    }
	APPLAYER* app = new APPLAYER(OP_MobUpdate, sizeof(SpawnPositionUpdate_Struct));
	SpawnPositionUpdate_Struct* spu = (SpawnPositionUpdate_Struct*)app->pBuffer;
	MakeSpawnUpdate(spu);
	app->priority = 6;
	entity_list.QueueClients(this,app);
	safe_delete(app);
	return ret;
}
No guarantees on whether any of those packets will work with newer versions than 0.5.3
Reply With Quote
  #18  
Old 05-28-2008, 06:24 PM
Wiz
Dragon
 
Join Date: Feb 2002
Posts: 583
Default

We also do player charm in a similar way, by toggling 'client loses control' and forcing movement with MobUpdate packets. I haven't found any other way to move a player, and while it isn't entirely smooth, it works fine.
Reply With Quote
  #19  
Old 05-28-2008, 06:27 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Wiz View Post

We've disabled the actual fear movement for the moment because its a lot more troublesome to keep players from going through walls than it is to do npcs,
Thanks Wiz. I'll have a look to see if those AppearancePackets work with 6.2/Titanium. Why is it more troublesome to keep players from going through walls than it is for NPCs ?
Reply With Quote
  #20  
Old 05-28-2008, 06:31 PM
Wiz
Dragon
 
Join Date: Feb 2002
Posts: 583
Default

Quote:
Originally Posted by Derision View Post
Thanks Wiz. I'll have a look to see if those AppearancePackets work with 6.2/Titanium. Why is it more troublesome to keep players from going through walls than it is for NPCs ?
Client movement is more unpredictable, partly because of lag / sync and partly because of the forced client physics - if a npc goes halfway into a wall it wont be affected, but a player might be teleported to the safe spot or fall through the world. The problem gets worse when you have .map files with LOS glitches that can send a player through a solid object.

I've got it working in 99% of all areas, but we still had some problem places, particularily in zones with imperfect .map files.

EDIT: Oh, in case it's not obvious, that movement function is meant to be called every 100ms. It gives a player roughly the same speed you get using the movement keys.
Reply With Quote
  #21  
Old 05-30-2008, 04:07 PM
KingMort
Banned
 
Join Date: Sep 2006
Posts: 841
Default

Wiz actually giving something back to the eqemu community ?

*BOGGLE*

*GASP*
Reply With Quote
  #22  
Old 05-30-2008, 04:22 PM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quote:
Originally Posted by KingMort View Post
*GASP*
It's not the first time, nor is it a rare occurance. He just doesn't make a big deal about it when he does.

As for the fixes, has Derision's implementation been tested enough to put into the server code?
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #23  
Old 05-30-2008, 04:24 PM
Wiz
Dragon
 
Join Date: Feb 2002
Posts: 583
Default

Quote:
Originally Posted by KingMort View Post
Wiz actually giving something back to the eqemu community ?

*BOGGLE*

*GASP*
Fly away, little troll.
Reply With Quote
  #24  
Old 05-30-2008, 04:58 PM
KLS
Administrator
 
Join Date: Sep 2006
Posts: 1,348
Default

Yeah I tested it, changed a few things. It works surprisingly well on non eqg maps. Something is seriously wrong with the way we make the eqg .maps though.
Reply With Quote
  #25  
Old 05-30-2008, 06:40 PM
Scorpious2k's Avatar
Scorpious2k
Demi-God
 
Join Date: Mar 2003
Location: USA
Posts: 1,067
Default

Quote:
Originally Posted by KLS View Post
Yeah I tested it, changed a few things. It works surprisingly well on non eqg maps. Something is seriously wrong with the way we make the eqg .maps though.
OK, then I'll move it to source unless you have already done it.
__________________
Maybe I should try making one of these servers...
Reply With Quote
  #26  
Old 06-01-2008, 01:33 PM
Derision
Developer
 
Join Date: Feb 2004
Location: UK
Posts: 1,540
Default

Quote:
Originally Posted by Wiz View Post
SOD has player fear, the packet is an apperancepacket that toggles "player loses control" on, but this is for an old client version, so I don't know if its applicable.
The same approach works with the 6.2 and Titanium clients:

http://www.rama.demon.co.uk/playerfear.patch

I'm posting this patch for anyone who wants to test and develop it some more (as I'm a bit burned out at the moment), and not suggesting it is ready to put on a 'live' server, as I really just hacked it in in what seemed appropriate places.

Movement is a little jerky, and player animations don't look right (they tend to walk very fast rather than running).

I tested by casting fear (as a GM) on another player, and also by putting Dragon Roar in Naggy's spell list and getting feared by him.

The patch is against version 1110
Reply With Quote
  #27  
Old 06-01-2008, 05:21 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

So, fear was added into the 1110 eqemu code update. So far, it looks very well done. Also, mobs are now running at 20% health.

I notice that some mobs run everytime and some never run. What is it that decides wether a mob will run or not? I can't seem to find any particular common setting on the npc_types that say whether they should run or not. I do like the option of being able to set NPCs to run like live, but I don't think it is very good if I can't figure out how to turn it off lol. I have some zones with mobs that have high run speeds and having them run away could get quite messy.

And, if there isn't already an option to enable or disable running, maybe one could be added in similar to the "f" immune to fleeing or "D" immune to fear special attack codes.

Overall though, this looks like some excellent work! I had fear disabled in many zones because of it's previous exploitablility, but now I can finally enable it and let the chaos begin lol!
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #28  
Old 06-01-2008, 05:30 PM
Throttle
Fire Beetle
 
Join Date: May 2008
Location: Denmark
Posts: 22
Default

Certain types of mobs never run, such as undead and summoned-type mobs. I don't know if that's what you meant.
Reply With Quote
  #29  
Old 06-01-2008, 05:41 PM
trevius's Avatar
trevius
Developer
 
Join Date: Aug 2006
Location: USA
Posts: 5,946
Default

I was thinking that body-type may have been what was deciding whether they should run or not. That may very well be the case. If so, it would be nice to still have another option other than changing the body type on all NPCs I don't want to run. I definitely don't want to have to set them all to summoned/undead.

I will have to do some more testing with it. Otherwise, I will have to consider either finding a way to disable running or add in a freebie item with clickie snare on it. Adding in running can completely change how much of my content was designed. Not that it is a bad thing, but it would be good to have an option imo.
__________________
Trevazar/Trevius Owner of: Storm Haven
Everquest Emulator FAQ (Frequently Asked Questions) - Read It!
Reply With Quote
  #30  
Old 06-01-2008, 05:59 PM
John Adams
Demi-God
 
Join Date: Jul 2006
Posts: 1,552
Default

I believe there's a combat rule for FleeHPRatio, default 25? Not sure if you are looking to stop fleeing altogether, but that might do it.

Otherwise, there used to be some defines in features.h in regards to fleeing you can disable and recompile.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

   

All times are GMT -4. The time now is 02:21 PM.


 

Everquest is a registered trademark of Daybreak Game Company LLC.
EQEmulator is not associated or affiliated in any way with Daybreak Game Company LLC.
Except where otherwise noted, this site is licensed under a Creative Commons License.
       
Powered by vBulletin®, Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Template by Bluepearl Design and vBulletin Templates - Ver3.3