SVN Revision 2651

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

Moderators: Support Team, Developer Team

SVN Revision 2651

Postby DOLBot » Wed Nov 03, 2010 1:43 pm

Commit from dre77

Log Messages
- Bugfix: '/mob viewloot' didn't checked properly their arguments
- Bugfix: loss of fraction in GameLiving.GetWeaponSkill() (always return 0 for level < 25)
- Removed: Check on name for a charm spell (you can use AmnesiaChance and BodyType for forbid the charm)

Files Changed:
MODIFY - DOLSharp/trunk/GameServer/commands/gmcommands/mob.cs
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GameLiving.cs
MODIFY - DOLSharp/trunk/GameServer/spells/CharmSpellHandler.cs

View Changes:
http://dolserver.svn.sourceforge.net/dolserver/?view=rev&rev=2651
User avatar
DOLBot
DOL Bot
 
Posts: 1933
Joined: Sat Jan 08, 2011 1:23 pm

Re: SVN Revision 2651

Postby Tolakram » Wed Nov 03, 2010 4:29 pm

Why the change to Charm spell handler? Most servers, including Storm, do not have body types defined. What am I missing?
- 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 Dre » Wed Nov 03, 2010 7:50 pm

Because you can use the BodyType for a temporary state and a check on the name isn't a good way...

You can just doing that:
Code: Select all
UPDATE mob SET BodyType = 1 WHERE Name = LOWER(Name);
UPDATE Spell SET AmnesiaChance = 1 WHERE Type = 'Charm';


When the body type will be implemented, we need to change it in any case...
Admin of Amtenael
Dre
Developer
 
Posts: 206
Joined: Fri Oct 29, 2004 6:24 pm
Website: https://amtenael.fr

Re: SVN Revision 2651

Postby Graveen » Wed Nov 03, 2010 7:56 pm

Well, this is exactly what was missing to this commit - SQL for compatibility.

Better for now ! :)
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 Tolakram » Wed Nov 03, 2010 8:07 pm

Yep, that's good.
- 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 Tolakram » Wed Nov 03, 2010 10:56 pm

Actually we need to do binary searches.

Code: Select all
UPDATE mob SET BodyType = 1 WHERE binary Name = LOWER(Name);
UPDATE mob SET BodyType = 0 WHERE binary Name <> LOWER(Name);
- 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 Tolakram » Thu Nov 04, 2010 1:12 pm

Here's why we must always test our changes before committing.

Code: Select all
                if (m_spell.AmnesiaChance != 0)
                {
                    if (((GameNPC)target).BodyType != m_spell.AmnesiaChance)
                {
                       MessageToCaster("This spell does not charm this type of monster!", eChatType.CT_SpellResisted);
                    return;
                }
                    return;
                }


See that last return? If AmesiaChance != 0 then all charm spell are broken. I just committed a fix.

This was not your code, but changes made by you to force AmesiaChance to not be 0 exposed this flaw, which would have been caught if tested. Catching old bugs is good. Me having to fix code because it wasn't tested ... not so much. :mrgreen:
- 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 Phen » Thu Apr 26, 2012 12:50 am

- Sorcerer, Minstrel and Mentalist charms now charm additional monster types at higher levels. The first spell in each line charms humanoids only. The second adds animal type monsters, the third adds insect type monsters, and the fourth adds magical type monsters. This should alleviate some issues with finding pets at different level ranges.

http://support.darkageofcamelot.com/kb/ ... php?id=436

We have now implemented some BodyTypes on Storm per Argo iirc, but now i am seeing a report that certain mobs aren't charmable specifically Humanoids with the 1st tier charm spell due to BodyType > 1. Not sure what a good workaround for this is.
Phen
Storm GM
 
Posts: 674
Joined: Thu Jun 12, 2008 12:55 am
Yahoo Messenger: KerzedSoul@yahoo.com

Re: SVN Revision 2651

Postby Argo » Thu Apr 26, 2012 6:08 am

Yeah i added bodytypes some time ago, i remember it took me ages to assign them :D but if they interfere with your plans now then it might be better to remove them from the NPCTs until found a way to handle them.
Möge Gott sein zwischen Dir und dem Leid, an allen dunklen und verlassenen Orten, die Du erreichen wirst.
Argo
Server Team
 
Posts: 1760
Joined: Thu Sep 18, 2008 6:21 pm
Location: Berlin, Germany

Re: SVN Revision 2651

Postby Phen » Mon May 28, 2012 8:16 pm

can we adjust
if (((GameNPC)target).BodyType != m_spell.AmnesiaChance)
to
if (((GameNPC)target).BodyType >= m_spell.AmnesiaChance)

so players can charm mobs ?
currently anything with a bodytype not equal to amnesiachance cannot be charmed
this will allow us to assign the types of mobs charmed by adjusting the amnesiachance in the DB according to spell level
otherwise we're going to have to change every mob in npctemplate
Phen
Storm GM
 
Posts: 674
Joined: Thu Jun 12, 2008 12:55 am
Yahoo Messenger: KerzedSoul@yahoo.com

Re: SVN Revision 2651

Postby Graveen » Mon May 28, 2012 8:54 pm

Ok my friend, here it is !
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 11:50 am

I'm currently working on the Charmspell Handler...

Was really badly written and did not follow core coding rules (ugly IF statement for BodyType Checking)

but honestly I get to a point where my "Live Knowledge" is not enough to properly finish this code...

Why is there a check for Named mobs inside Charm Handler to prevent spell to land ? I have seen a lot of "Charm" Guides that report using Named mobs as pets... (and some mobs could have an Upper case letter not on the first letter... like "daughter of Medb" !)
Code: Select all
if (target.Name != target.Name.ToLower()) { //Needs livelike message MessageToCaster("This monster can't be charmed!", eChatType.CT_SpellResisted); return; }
I want to remove this part as, for me, the GOOD way to prevent a mob from being charmed is to set his BodyType to 0 !(None)

Talking about bodytype, I couldn't find any data about Reptile/Plant being included in Minstrel/Mentalist Pusling chants ? There is description about them charming Humanoid, Animal, Insect, Magical, Undead, and finally ALL, I wonder if these class aren't meant to charm Plant or Reptile before last charm spell ?

Hunter has a specific "Reptile" (as well as Animal and Insect) Charm spell, and I think permanent charm (Sorcerer/SpiritMaster) can target any bodytype (maybe a bonus to the fact they can't charm above caster level, at game release Sorcerer could only charm humanoid all the way !)


I checked some old Charm guides : http://charm.enygma.net/petguide.html

Hibernia guide reports "Moss Sheerie" and "Rock Sprite" as being good pets, but these are Elementals according to Allkhazam, Hibernia can't charm these until last level charm ! (or Elemental is Inside Magical Type ?)

The Same with "Faerie Drake" being reported as Drake, about level 20-22 shouldn't be charm-able until later level

I can't get my mind clear, as this could be coop server reports...


I would like the level 3 charm (Human, Animal, Insect) to charm Reptile too, and level 4 (+Magical) to charm Plant and Elemental (Trees moving, if it's not magic what is it !?)

That would leaves Demon, Dragon, Giant for the last level of these pulsing charms (even if I could put Dragon in Animal or Reptile/Insect levels, Giant in Magic, and only Demon gained from later level)

I want to be as live-like as possible, but prevent that players can't find anything to charm due to strong restrictions and mobs templating errors...
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 1:00 pm

Here is my "Stub" patch

It's more a "code" oriented explanation to my above post than a really finished patch (it compiles, but isn't tested !)

I'm wondering, there was a discussion in an other topic (can't find it back) about why some mobs resisted more to pulsing charms than other... And I don't see any code in this charm handler about spell damage type being used for resist ??

I know Minstrel is Body dmg chant, and Mentalist is Heat dmg chant, maybe mobs race resists should be taken into account for tick resists ?


Explanation of change :

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 ?)

Moved : 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" stmt to Drop Down Switch (now it's Ugly goto... but I really had the C/C++ switch case drop down in head... this can't work in C# without goto case !) for charmtype vs bodytype checks.

Cleaned : mostly readability, spacing, indent



See later posts for updated file
Last edited by Leodagan on Thu Sep 05, 2013 5:17 pm, edited 2 times in total.
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 2:30 pm

Seems better !

Anyhow, the database is not actually ready for such a change.

Tola, what is the impact on Storm D2 ?
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 2:44 pm

it does the same as the initial code for now ;)

It's just rewrited clearly, cleaned, optimized, with an enum to list "Amnesia chance" used for charm mob type (which make it easier to read and will help ppl populating their DB)

I don't know how you implemented your charm spells on Storm, but if it's set to "Amnesia chance" = 0 (like it should be with previous code to be able to charm anything) I'm pretty sure it still does the same effect :)
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