Page 1 of 1

Disable weapons breaking when parrying?

Posted: Mon May 02, 2016 11:36 am
by Buckyohare
Hi guys, I was wondering if anyone knew of a mod (or how to change the code somewhere) to prevent weapons breaking when parrying attacks.

I have been playing as a barb, and it's frustrating not being able to parry attacks without the fear of your weapon breaking, as the barb weapons are few and far between.

Thanks for your advice.

Re: Disable weapons breaking when parrying?

Posted: Tue May 03, 2016 11:23 am
by Tomash
Find function Damage.BreakMySword which looks like:

def BreakMySword(EntityName):
me=Bladex.GetEntity(EntityName)
if me.InvRight<>"":
Actions.Stop_Weapon (EntityName,"Stop_Weapon")
if Breakings.ExplodeSpecialObject ( me.InvRight , 24000.0)==1:
if Reference.EntitiesObjectData.has_key(me.InvRight):
del Reference.EntitiesObjectData[me.InvRight]
DropInvalidObjectsOnImpact (EntityName)
me.Wuea=Reference.WUEA_ENDED
me.LaunchAnmType("sword_broken")
inv=me.GetInventory()
inv.RemoveWeapon(me.InvRight)
inv.LinkRightHand("None")
if me.Data.NPC:
me.Data.ResetCombat (EntityName)

Make it look like:

def BreakMySword(EntityName):
print "no more breaks"
#me=Bladex.GetEntity(EntityName)
#if me.InvRight<>"":
#Actions.Stop_Weapon (EntityName,"Stop_Weapon")
#if Breakings.ExplodeSpecialObject ( me.InvRight , 24000.0)==1:
#if Reference.EntitiesObjectData.has_key(me.InvRight):
#del Reference.EntitiesObjectData[me.InvRight]
#DropInvalidObjectsOnImpact (EntityName)
#me.Wuea=Reference.WUEA_ENDED
#me.LaunchAnmType("sword_broken")
#inv=me.GetInventory()
#inv.RemoveWeapon(me.InvRight)
#inv.LinkRightHand("None")
#if me.Data.NPC:
#me.Data.ResetCombat (EntityName)

Re: Disable weapons breaking when parrying?

Posted: Tue May 03, 2016 5:31 pm
by prospero
You could edit the tables in Reference.py.

DefaultObjectData['Chaosword']= [OBJ_WEAPON, 5, 0, 2.0, THR_STRAIGHT, [W_FLAG_2W,PI,2000,750,100,100,GolpeArmaEscudoMetal]]

If you change the brk data in the last number (in this case 100 I have highlighted in purple) to 0 you may find the sword will become unbreakable.
I say 'may find' because I'm half-guessing. :roll:

You'll have to do the same to all other weapons you want unbreakable, but I think it's easier than trying to hook into functions.