PDA

View Full Version : /targetgroupbuff snippet


Wiz
06-01-2003, 02:11 AM
Add this to client.h


bool TGB() {return tgb;}
protected:
bool tgb;


Add this to EQ_Opcodes.h


#define OP_TargetGroupBuff 0x2042


NOTE: 0x2042 seems to be used for other purposes too, with the information 2... it also sends this opcode twice every time you type /tgb, with the information 2 being sent in the second packet. The purpose I don't know.

In client_process.cpp, find case 0x2042: and replace that section with this:


case OP_TargetGroupBuff: {
GlobalID_Struct* tgbs = (GlobalID_Struct*)app->pBuffer;
int16 tgbid = tgbs->entity_id ;
if (tgbid == 1)
{
if (!tgb)
Message(0,"Target Group Buff now ON");
tgb = true;
}
else if (tgbid == 0)
{
if (tgb)
Message(0,"Target Group Buff now OFF");
tgb = false;
}
break;
}


In spells.cpp, find: case ST_Group: case 0x3: and replace the section with:


case ST_Group:
case 0x3:
{
Mob* trg = this;
if (IsClient() && CastToClient()->TGB() && target && target->IsClient() && target->CastToClient()->isgrouped)
{
trg = target;
SpellOnTarget(spell_id,this);
}
if (trg->IsClient() && trg->CastToClient()->isgrouped && entity_list.GetGroupByClient(trg->CastToClient()) != 0)
entity_list.GetGroupByClient(trg->CastToClient())->CastGroupSpell(this->CastToClient(),spell_id);
else
SpellOnTarget(spell_id,this);
break;
}

haloboycs
06-04-2003, 02:20 AM
it works great on his WR server.

but one small problem, up on login, it shows 'Target Group Buff *ON*' .. eq live doesnt do that.

Trumpcard
06-04-2003, 03:34 AM
Why is it a problem? Because Live doesnt do it? I wouldnt say thats a problem, I would call that a difference...
Thanks Wiz!

killspree
06-04-2003, 08:10 AM
That's not a major problem, nice to update the players that it's on so they can decide to turn it off if need be.

Wiz
06-04-2003, 07:15 PM
One minor thing I missed, bool tgb = true; needs to be declared in Client::Client, that's all.

Trumpcard
06-06-2003, 02:58 AM
I merged this in last night. Mind taking a look Wiz and verified I implemented it correctly? It will be out on CVS today.


Thanks

Bigpull
06-08-2003, 06:16 AM
It's implemented almost verbatim, i made some small changes.
tgb defaults to false (it's stored client side)
and 2 is the tgb status requester.

Bugs:
Target can change while casting, (eg, tab)
Target doesn't get buffed if not grouped. (caster gets hit twice)
IPC can't cast group spells.

Wiz
06-09-2003, 11:33 PM
It's implemented almost verbatim, i made some small changes.
tgb defaults to false (it's stored client side)
and 2 is the tgb status requester.

Bugs:
Target can change while casting, (eg, tab)
Target doesn't get buffed if not grouped. (caster gets hit twice)
IPC can't cast group spells.

Target can change while casting is possible on live too, that's not a tgb bug, and shouldn't affect who gets hit by the spell.

Haven't implemented a fix for buffing someone ungrouped yet.

IPC?

fnemo
06-09-2003, 11:47 PM
Interactive Player Character ... Bot :)

Wiz
06-10-2003, 01:53 AM
Interactive Player Character ... Bot :)

Ah. I don't use those, so someone else will have to code in support.

Wiz
06-10-2003, 01:56 AM
This will fix the bug with ungrouped targets.


case ST_Group:
case 0x3:
{
Mob* trg = this;
if (IsClient() && CastToClient()->TGB() && target && target != this && target->IsClient())
{
trg = target;
SpellOnTarget(spell_id,this);
}
if (trg->IsClient() && entity_list.GetGroupByClient(trg->CastToClient()) != 0)
entity_list.GetGroupByClient(trg->CastToClient())->CastGroupSpell(this->CastToClient(),spell_id);
else
SpellOnTarget(spell_id,trg);
break;
}