Search found 7 matches

by Vaguereach
Sun Jan 13, 2013 4:30 am
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Re: Running script with Champion.OnAttack?

Soo... now I'm stuck trying to use a numeric for loop. I don't know if it's because I'm referencing the spawner in my level incorrectly or because I need to use a generic for loop... This is an aside, I'm just familiarising myself with the language. Cheers! function skeleSpawn() for i=1,3 do skelesp...
by Vaguereach
Sat Jan 12, 2013 2:10 pm
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Re: Running script with Champion.OnAttack?

That's a good thought too - having it apply on equip item might involve considerably more code (or not ... hmmm) but it would allow the dexterity bonus applied to bow damage feel more intuitive and natural. My only concern is having to check all item equip slots (including backpack for head hunting ...
by Vaguereach
Sat Jan 12, 2013 11:10 am
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Re: Running script with Champion.OnAttack?

Fixed it by using weap.name (instead of just weap).

So simple.

Will update when I have finished working script.
by Vaguereach
Sat Jan 12, 2013 10:45 am
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Re: Running script with Champion.OnAttack?

P.S. - I'm thinking I might need to change something in the objects.lua? I.e. when the onAttack hook triggers, should I be passing the weapon.uiName or something as opposed to just the weapon? the onAttack hook for the party apparently "gets the attacking champion and the weapon used to attack&...
by Vaguereach
Sat Jan 12, 2013 10:12 am
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Re: Running script with Champion.OnAttack?

Hmmm... If I use weap = tostring(party:getChampion(x):getItem(7)) where x is equal to the ordinal number of the champion, I'm passed information from a table which seems to the weapon ID and not the weapon name. I.e. by printing weap with print(weap) I receive "table: 0x0f46ad60". Note tha...
by Vaguereach
Sat Jan 12, 2013 8:35 am
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Re: Running script with Champion.OnAttack?

I've made a working script using the onDamage hook but I think you were right when you suggested basing it off the onAttack of the party. Not only does that save me cloning every single monster in the game, it also passes the right information (I didn't realize that the missle damage type was physic...
by Vaguereach
Thu Jan 10, 2013 10:24 am
Forum: Modding
Topic: Running script with Champion.OnAttack?
Replies: 9
Views: 6528

Running script with Champion.OnAttack?

Hello there, I'm writing a mod that implements a damage increase for missile weapons based on dexterity. I have a formula in mind and a plan of action but I have (potentially) two concerns... Is there a way to execute a script when a monster is hit/takes damage or alternatively when a player attacks...