How to apply EFF_Files only when equipping either melee or range weapon
gattberserk
Member Posts: 191
Hi guys,
Just wanna ask which opcode should I use to create an effect that only apply when I use either range / melee weapon.
For eg.: Extra 1 APS when using melee weapon.
Is such an effect possible?
I try to to look for similar item effect in BGEE, and archer eyes is the closest but it bug me with its interesting opcodes.
It uses opcode 301 with [0x1, 0x1], which means apply 5% critical chance on this weapon. Does it means the items description doesn't apply since it mention only +5% Critical hit chance on ranged attack. How does the engine differentiate between ranged or melee weapon.
Do enlighten me
Just wanna ask which opcode should I use to create an effect that only apply when I use either range / melee weapon.
For eg.: Extra 1 APS when using melee weapon.
Is such an effect possible?
I try to to look for similar item effect in BGEE, and archer eyes is the closest but it bug me with its interesting opcodes.
It uses opcode 301 with [0x1, 0x1], which means apply 5% critical chance on this weapon. Does it means the items description doesn't apply since it mention only +5% Critical hit chance on ranged attack. How does the engine differentiate between ranged or melee weapon.
Do enlighten me
0
Comments
Thanks for the insight, but i am still not sure what opcode to use or apply to opcode 177.
If i select damage type for 177 ids file would that help?
Also regarding the archer eyes, do you mean there is a 3rd parameter that select ranged attack?
@subtledoctor if you want to restrict an equipped effect to only apply after a certain level, you can use the fields at offset 0x1c and 0x20 of an item/spell effect:
0x1c = # dice thrown / maximum level.
0x20 = Dice size / minimum level.
Some opcodes use these fields for Dice, such as Opcode12:Damage, the rest use them to restrict level ranges.
If the opcode does use them as dice, or you need to restrict the effect through opcode 177 anyway, you can to set the min/max level in opcode 177 effect, and set the fields in the *.eff for dice values:
That apply to throwing axes and knives
Which is why I want to apply +1 APR only to a melee weapon.
Since there's almost incentive to switch from melee to ranged within a single round due to positioning issues, the exploit wouldn't actually be useful. So the only flaw is that your first melee attack would occur, at worst, 1.5 seconds slower than normal.
Would be far simpler to just impose a ranged Thac0/damage Penalty when using said shield.
Would that be better?
Opcode 321 is the key. Removal: Effect specified by Resource.
First I created 2 spells.
Spell 1: opcode 321 (Spell 1) + 1 APR (for 2 round),
Spell 2: opcode 321 (Spell 1)
Set Melee Effect (248) using Spell 1
Set Ranged Effect (249) using Spell 2
Problem solve!