SVN Revision 3239 - Charm SpellHandler

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

Moderators: Support Team, Developer Team

SVN Revision 3239 - Charm SpellHandler

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

Updated Charm spell

Added : Enum for "amnesia chance" used to check mobs type, set them to the previous expected values for each type (so it's backward compatible with existing databases)
Added : charm type for Reptile (recent Hunter changes)
Changed : Shorts checks area using declared variables into direct casted member call insides statements. (memory matters ?)
Changed : Most of target basics check (is expected class, is not null, is alive, is not controlled) above the resists area or other game rules (Optimizations)
Changed : Ugly "IF" statement to Drop Down Switch for charmtype vs bodytype checks.
Cleaned : mostly readability, spacing, indent
Added : Serverproperty to enable named check in charm handler.


Forgot in SVN commit description :
Fix : Mob Name color update when releasing pet

http://sourceforge.net/p/dolserver/code/3239/

This is updates from topic: http://www.dolserver.net/viewtopic.php? ... 15#p149258
User avatar
Leodagan
Developer
 
Posts: 1350
Joined: Tue May 01, 2012 9:30 am
Website: https://daoc.freyad.net
Location: Lyon

Re: SVN Revision 3239 - Charm SpellHandler

Postby Graveen » Fri Sep 06, 2013 5:25 pm

Just a quick note, i see you duplicated types (Human, Insect, HumanInsect), and i guess flag-style is better (ie, not new enum HumanInsect but checked versus Human+Insect).

Have you considered this options, or think it was problematic to implement, or running into more troubles (actual compatibility, etc...) ?

Thanks !
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 3239 - Charm SpellHandler

Postby Leodagan » Fri Sep 06, 2013 5:48 pm

i though of it....

When I first wrote this enum Charm type "ALL" was 128, so I was going to use a binary comparison on this :)

but then I remembered the previous version was using arbitrary value of Amnesia Chance to check for what it can charm, so I used the same values for the enum, to be sure people who already used these will still have same effect !

That made me change a lot of the code style I wanted to use, but it's one step further to the binary solution ;)
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