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

04-30-2008, 07:33 AM
|
|
Forum Guide
|
|
Join Date: Sep 2003
Location: California
Posts: 1,474
|
|
Please have a look at the code - and see if it can be adapated to current, then this would be a great addition to base code.
Thanks Wiz
GeorgeS
|

04-30-2008, 06:39 PM
|
|
Discordant
|
|
Join Date: Jun 2005
Posts: 286
|
|
Yeah this would be incredible! Good luck on the adaption.
__________________
-Croup (the rogue)
Creator of Pandemic (PvP-Racewars)
|

05-24-2008, 08:09 AM
|
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
I don't know if anyone has already integrated Wiz's fear code, however I spent a few hours last night
and this morning on it.
Patch against 1108: http://www.rama.demon.co.uk/wizfear.patch
Full 1108 source with Wiz's fear code: http://www.rama.demon.co.uk/EQEmu-0....WizFear.tar.gz
I only did limited testing on it, so use at your own risk
Any bugs are my fault. Kudos to Wiz for releasing his source.
|

05-24-2008, 10:29 AM
|
|
Banned
|
|
Join Date: Jan 2006
Location: /dev/null
Posts: 99
|
|
This works great acually =). Testing it out now on my server. Thanks man.
|

05-24-2008, 11:25 AM
|
|
Banned
|
|
Join Date: Jan 2006
Location: /dev/null
Posts: 99
|
|
the only thing i'm having trouble with atm, is players acually getting feared. I'm looking into that now.
|

05-24-2008, 01:49 PM
|
|
Developer
|
|
Join Date: Feb 2004
Location: UK
Posts: 1,540
|
|
Quote:
Originally Posted by jenco420
the only thing i'm having trouble with atm, is players acually getting feared. I'm looking into that now.
|
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.
|

05-24-2008, 04:07 PM
|
|
Hill Giant
|
|
Join Date: Jun 2006
Location: San Jo, Cali
Posts: 180
|
|
Wiz, i would just like to thank you for your generosity, really very kind 
|
 |
|
 |

05-28-2008, 06:15 PM
|
|
Dragon
|
|
Join Date: Feb 2002
Posts: 583
|
|
Quote:
Originally Posted by Derision
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
|
 |
|
 |
| Thread Tools |
|
|
| Display Modes |
Hybrid Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -4. The time now is 12:16 PM.
|
|
 |
|
 |
|
|
|
 |
|
 |
|
 |