Page 2 of 2
Re: SVN Revision 2651
PostPosted: Wed Sep 04, 2013 3:08 pm
by Tolakram
I think we need a charm check server property so that an operator can choose to use legacy DOL checks or strictly use the DB.
I don't think there is any D2 impact, I would rather they be able to charm named mobs, and they won't be able to charm the bosses. That would be amusing though.

Re: SVN Revision 2651
PostPosted: Wed Sep 04, 2013 3:48 pm
by Leodagan
I think if an Higher level charm class make his pet from a lower level Boss, it's fun
It shouldn't go really far with every zoning area and bosses being mostly in Dungeon...
The only thing it could be bad is someone charming a named with OTD in open land, and keep him away from spot for a long time ! (but these OTD aren't really hunted now)
Well I was thinking of a server property only for the named checks I want to remove, as I said earlier the remaining code should do exactly the same as before
Edit : That made me think that it would be better to check if the target is involved in a quest or anything like this !
Re: SVN Revision 2651
PostPosted: Wed Sep 04, 2013 4:23 pm
by Leodagan
Updated initial file in my post...
There was some checks that shouldn't be done outside the "only when it's a new charm pulse" code area.
I can now say this is tested and behave like the old code, except for named
I'll put back the "Named" code and commit, if I'm too lazy to write a property !
Re: SVN Revision 2651
PostPosted: Wed Sep 04, 2013 4:54 pm
by Graveen
\o/

Re: SVN Revision 2651
PostPosted: Wed Sep 04, 2013 5:52 pm
by Leodagan
The mob Colored Name doesn't return to initial one after pet is release from control...
This happen on current SVN version too !
I have no idea where to begin to be sure this name displays back to the CON color of mob. For now the mob appear with the friendly color even when he's released and aggro the caster !
Re: SVN Revision 2651
PostPosted: Wed Sep 04, 2013 9:11 pm
by Graveen
SendMobUpdate() should do the job.
Re: SVN Revision 2651
PostPosted: Thu Sep 05, 2013 8:33 am
by Leodagan
There is no match for 'SendMobUpdate' in all project
I used SendObjectUpdate but it doesn't work, I checked other proc with "NPC" in name
There is SendNPCCreate, I though I could find the something about sending CON color data and all I found is :
byte level = npc.GetDisplayLevel(m_gameClient.Player);
if((npc.Flags&GameNPC.eFlags.STATUE)!=0)
{
level |= 0x80;
}
pak.WriteByte(level);
But I'm not sure this is really what I'm looking for, and this isn't used around "Update" code (npc.BroadCastUpdate() use SendObjectUpdate(), SendObjectUpdate has no code to send level or similar)
This lead me to search around level changing handler to check what proc they use !
Re: SVN Revision 2651
PostPosted: Thu Sep 05, 2013 9:01 am
by Leodagan
While lurking through GameNPC, /mob handler, and PacketLib I found this :
- Code: Select all
public override eRealm Realm
{
get
{
IControlledBrain brain = Brain as IControlledBrain;
if (brain != null)
return brain.Owner.Realm; // always realm of the owner
return base.Realm;
}
set
{
base.Realm = value;
if (ObjectState == eObjectState.Active)
{
foreach (GamePlayer player in GetPlayersInRadius(WorldMgr.VISIBILITY_DISTANCE))
{
player.Out.SendNPCCreate(this);
if (m_inventory != null)
player.Out.SendLivingEquipmentUpdate(this);
}
BroadcastUpdate();
}
}
}
It looks like GameNPC code have no problem using PacketLib SendNPCCreate just to Update NPC Realm !
So that make me think the developer who made NPCCreate + EquipmentUpdate + BroadcastUpdate, had some trouble too with updating Name CON color to client

(or other parts of the mob)
Charm Handler doesn't call realm update, as it replace "Brains", but I remember using /mob realm to change world NPC didn't always updated the Displayed Name... (Can't try all this from work...)
Re: SVN Revision 2651
PostPosted: Thu Sep 05, 2013 9:44 am
by Leodagan
Found in CharacterBaseClass.cs
When a player have a pet added to his controlled brain
if (controlledBrain.Body != null)
{
Player.Out.SendNPCCreate(controlledBrain.Body); // after open pet window again send creation NPC packet
if (controlledBrain.Body.Inventory != null)
Player.Out.SendLivingEquipmentUpdate(controlledBrain.Body);
}
SendNPCCreate on target mob being controlled...
This is not done when SetControlledBrain is called with "null" (removing Brain), but anyway that is just for the player casting the charm...
Re: SVN Revision 2651
PostPosted: Thu Sep 05, 2013 4:07 pm
by Leodagan
I copy pasted code from GameNPC.Realm changing procedure
And merged it with Guild Code (which seems to be used for PvP purpose)
Solved everything
I'll provide patch after more testing
Update : There is the patch, everything work as expected except Named check...
I'll get a try at creating serverproperty for that

Re: SVN Revision 2651
PostPosted: Thu Sep 05, 2013 6:56 pm
by Graveen
Thank you, this is easy to create a serverproperty.
Re: SVN Revision 2651
PostPosted: Fri Sep 06, 2013 7:42 am
by Leodagan
Committed to SVN with serverproperty check, default to previous behavior.
http://www.dolserver.net/viewtopic.php?f=59&t=21619