Page 1 of 1

SVN Revision 3096

PostPosted: Fri May 25, 2012 2:09 am
by DOLBot
Commit from matt450

Log Messages
Changed: Proc handling change, if item model is Bruiser (model 1671/2113), allow procs to fire on keep components and keep doors.

Files Changed:
MODIFY - DOLSharp/trunk/GameServer/gameobjects/GameLiving.cs

View Changes:
http://dolserver.svn.sourceforge.net/do ... v&rev=3096

Re: SVN Revision 3096

PostPosted: Fri May 25, 2012 6:57 am
by Graveen
I totally understand the quickfix, but it should not be done in this way, the model is a too generic base from a shard to another.

What i suggest:
- create a new blank class inheriting from GameInventoryItem (or ItemTemplate, w/e is suitable)
- perform this check in regard of this new class

/wave :)

Re: SVN Revision 3096

PostPosted: Fri May 25, 2012 2:36 pm
by mattress
I thought about that briefly, kinda figured it was overkill to make a class for this specific item, so I went with the model, I'll change it and get it committed sometime today. I was going to use a check for the name Bruiser, but figured that wasn't very universal in terms of language since Bruiser might translate to something different in another language.

Re: SVN Revision 3096

PostPosted: Fri May 25, 2012 3:33 pm
by Graveen
With the class, you can also extend it to handle an effect, a specific sound, a complex trigger ( you hit with the sword of betrayal ? you are teleported to the Lord).

Another possible way is to rule it with a serverproperty, but this is a quick fix too - but more acceptable than an hardcoded one.

Re: SVN Revision 3096

PostPosted: Fri May 25, 2012 4:24 pm
by mattress
Created the class, tested and committed, asterick pointed out to me that this will work for the Fools Bow also, I'll have to take a look at the proc on that one (if it has one).

Re: SVN Revision 3096

PostPosted: Wed Jul 04, 2012 5:49 pm
by mattress
Taking another look at this after a bit of a break....since the object class thing was a bit complicated, can we just use a flag in ItemTemplate, say, 10 (can't find any instances of this number being used anywhere else), to allow procs to fire on keepcomponents?
Code: Select all
public override bool AllowWeaponMagicalEffect(AttackData ad, InventoryItem weapon, Spell weaponSpell)
{
if (weapon.Flags == 10)
return true
else return false; // special code goes here
}

Re: SVN Revision 3096

PostPosted: Wed Jul 04, 2012 6:40 pm
by Graveen
it's better, but, what is the problem with a new class inheriting from itemtemplate ?

Re: SVN Revision 3096

PostPosted: Wed Jul 04, 2012 9:25 pm
by mattress
The new class won't apply to artifacts, when the server starts up, ArtifactMgr references the Artifact and ArtifactXItem table and all the artifacts in players inventories become InventoryArtifact objects. The class on the Bruiser ItemTemplate was changed to DOL.GS.GameSiegeItem, but the class doesn't carry over when the server starts up.

Re: SVN Revision 3096

PostPosted: Wed Jul 04, 2012 11:16 pm
by Tolakram
I think flags are fine for now, with a comment about artifacts included. If or when artifacts are re-written to use the new items types then the code for these can change. Dealing with legacy crap here.