SVN Revision 2651

View and discuss the latests SVN commits, to ensure the best efficiency in our work.

Moderators: Support Team, Developer Team

Re: SVN Revision 2651

Postby Tolakram » Wed Sep 04, 2013 3:08 pm

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. :D
- Mark
User avatar
Tolakram
Storm / Storm-D2 Admin
 
Posts: 9189
Joined: Tue Jun 13, 2006 1:49 am
Location: Kentucky, USA

Re: SVN Revision 2651

Postby Leodagan » Wed Sep 04, 2013 3:48 pm

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 !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Leodagan » Wed Sep 04, 2013 4:23 pm

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 !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Graveen » Wed Sep 04, 2013 4:54 pm

\o/ :)
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: SVN Revision 2651

Postby Leodagan » Wed Sep 04, 2013 5:52 pm

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 !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Graveen » Wed Sep 04, 2013 9:11 pm

SendMobUpdate() should do the job.
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: SVN Revision 2651

Postby Leodagan » Thu Sep 05, 2013 8:33 am

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 !
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Leodagan » Thu Sep 05, 2013 9:01 am

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 :D (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...)
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Leodagan » Thu Sep 05, 2013 9:44 am

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...
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Leodagan » Thu Sep 05, 2013 4:07 pm

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 ;)
Attachments
CharmSpellHandler.cs.patch
(21.67 KiB) Downloaded 107 times
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 2651

Postby Graveen » Thu Sep 05, 2013 6:56 pm

Thank you, this is easy to create a serverproperty.
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: SVN Revision 2651

Postby Leodagan » Fri Sep 06, 2013 7:42 am

Committed to SVN with serverproperty check, default to previous behavior.

http://www.dolserver.net/viewtopic.php?f=59&t=21619
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon


Return to “%s” DOL SVN Commits

Who is online

Users browsing this forum: No registered users and 1 guest