Stun in "Melee Attack"

Ask for help about creating mods and scripts for Grimrock 2 or share your tips, scripts, tools and assets with other modders here. Warning: forum contains spoilers!
Post Reply
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Stun in "Melee Attack"

Post by David Ward »

We're trying to make a weapon have a stun chance on melee attack, but cannot find the correct syntax for the component. For example:

{
class = "MeleeAttack",
name = "slash",
uiName = "Power Slash",
energyCost = 25,
pierce = 15,
attackPower = 32,
--stunChance = 80,
buildup = 2,
cooldown = 6,
swipe = "horizontal",
attackSound = "swipe_heavy",
gameEffect = "Buildup: 2 seconds",
},

stunChance = 80, of course, does nothing. What would be the correct code?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Stun in "Melee Attack"

Post by minmay »

causeCondition = "stunned",
conditionChance = 80,
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Stun in "Melee Attack"

Post by David Ward »

TY minmay.

Is there a way to change how long a stun effect will last?
minmay
Posts: 2790
Joined: Mon Sep 23, 2013 2:24 am

Re: Stun in "Melee Attack"

Post by minmay »

using MonsterComponent:setCondition("stun",30) or whatever in the onHitMonster hook should work
Grimrock 1 dungeon
Grimrock 2 resources
I no longer answer scripting questions in private messages. Please ask in a forum topic or this Discord server.
User avatar
David Ward
Posts: 103
Joined: Wed Jan 07, 2015 11:44 pm
Location: Vancouver, BC, Canada

Re: Stun in "Melee Attack"

Post by David Ward »

cheers
Post Reply