DevCrit Update
Devastating Critical should now do 10x damage instead of a fortitude save or die. Full compile. Updated release archive.
This commit is contained in:
parent
2444917a91
commit
c86dcbb715
@ -4948,7 +4948,7 @@
|
||||
},
|
||||
"Mod_MinPerHour": {
|
||||
"type": "byte",
|
||||
"value": 2
|
||||
"value": 3
|
||||
},
|
||||
"Mod_Name": {
|
||||
"type": "cexolocstring",
|
||||
|
Binary file not shown.
Binary file not shown.
BIN
_module/ncs/on_attack.ncs
Normal file
BIN
_module/ncs/on_attack.ncs
Normal file
Binary file not shown.
BIN
_module/ncs/on_devcrit.ncs
Normal file
BIN
_module/ncs/on_devcrit.ncs
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@ -11,6 +11,8 @@
|
||||
#include "x2_inc_switches"
|
||||
#include "x2_inc_restsys"
|
||||
#include "nwnx_webhook"
|
||||
#include "nwnx_weapon"
|
||||
#include "nwnx_damage"
|
||||
|
||||
//:: AmonBot Webhook
|
||||
const string NWNX_DISCORD_URL = "/api/webhooks/1187525263693725706/oRFVnrx9qq7mxmpwOaslNgaQoaVAchTlK-NGFOHv4_2fJMdl-AIAVfpid8L_Lm3gs3Qq/slack";
|
||||
@ -25,6 +27,10 @@ void main()
|
||||
SetEventScript(GetModule(), EVENT_SCRIPT_MODULE_ON_PLAYER_GUIEVENT, "mod_gui");
|
||||
|
||||
NUI();
|
||||
|
||||
//:: Bypasses & replaces Devastating Critical with 10x damage
|
||||
NWNX_Weapon_SetDevastatingCriticalEventScript("on_devcrit");
|
||||
NWNX_Damage_SetAttackEventScript("on_attack");
|
||||
|
||||
if (GetGameDifficulty() == GAME_DIFFICULTY_CORE_RULES || GetGameDifficulty() == GAME_DIFFICULTY_DIFFICULT)
|
||||
{
|
||||
|
59
_module/nss/on_attack.nss
Normal file
59
_module/nss/on_attack.nss
Normal file
@ -0,0 +1,59 @@
|
||||
#include "nwnx_weapon"
|
||||
#include "nwnx_damage"
|
||||
|
||||
void main ()
|
||||
{
|
||||
//if (!GetIsPC(OBJECT_SELF)) return; // again, only for PCs, up to you
|
||||
struct NWNX_Damage_AttackEventData data = NWNX_Damage_GetAttackEventData();
|
||||
// if local var "devcrit" is > 0 (set in the on devcrit event script) and the current attack is a crit
|
||||
if (GetLocalInt(OBJECT_SELF, "devcrit") && data.iAttackResult == 3) // 3 : critical hit
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "devcrit", GetLocalInt(OBJECT_SELF, "devcrit") - 1);
|
||||
//int nDC = 10 + GetHitDice(OBJECT_SELF) / 2 + GetAbilityModifier(ABILITY_STRENGTH, OBJECT_SELF);
|
||||
//int nFort = GetFortitudeSavingThrow(data.oTarget);
|
||||
//int nRoll = d20();
|
||||
//int nFortSave = nFort + nRoll;
|
||||
//if (nFortSave < nDC)
|
||||
//{
|
||||
//SendMessageToPC(OBJECT_SELF, GetName(data.oTarget)+" : Fortitude Save : *failure* : ("+IntToString(nRoll)+" + "+IntToString(nFort)+" = "+IntToString(nFortSave)+" vs. DC: "+IntToString(nDC)+")");
|
||||
|
||||
/* if (GetIsPC(data.oTarget)) SendMessageToPC(data.oTarget, "Devastating Critical Hit : Fortitude Save : *failure* : ("+IntToString(nRoll)+" + "+IntToString(nFort)+" = "+IntToString(nFortSave)+" vs. DC: "+IntToString(nDC)+")"); */
|
||||
|
||||
if (GetIsPC(data.oTarget))
|
||||
{
|
||||
SendMessageToPC(data.oTarget, "Devastating Critical Hit: 10x damage!");
|
||||
}
|
||||
|
||||
data.iAttackResult = 10; // 10 : dev crit
|
||||
|
||||
// do your stuff here
|
||||
|
||||
// if damage is going to kill the target set local var "devcrit" to 0 so there is no devcrit "queued up" for the next target
|
||||
int nTotalDamage =
|
||||
data.iBase * 10 +
|
||||
data.iSlash +
|
||||
data.iPierce +
|
||||
data.iBludgeoning +
|
||||
data.iFire +
|
||||
data.iAcid +
|
||||
data.iCold +
|
||||
data.iElectrical +
|
||||
data.iSonic +
|
||||
data.iMagical +
|
||||
data.iDivine +
|
||||
data.iNegative +
|
||||
data.iPositive;
|
||||
|
||||
if (nTotalDamage >= GetCurrentHitPoints(data.oTarget))
|
||||
{
|
||||
SetLocalInt(OBJECT_SELF, "devcrit", 0);
|
||||
}
|
||||
|
||||
//}
|
||||
/* else
|
||||
{
|
||||
SendMessageToPC(OBJECT_SELF, "Devastating Critical Hit on "+GetName(data.oTarget)+" failed. Fortitude Save : *success* : ("+IntToString(nRoll)+" + "+IntToString(nFort)+" = "+IntToString(nFortSave)+" vs. DC: "+IntToString(nDC)+")");
|
||||
if (GetIsPC(data.oTarget)) SendMessageToPC(data.oTarget, "Devastating Critical Hit : Fortitude Save : *success* : ("+IntToString(nRoll)+" + "+IntToString(nFort)+" = "+IntToString(nFortSave)+" vs. DC: "+IntToString(nDC)+")");
|
||||
} */
|
||||
}
|
||||
}
|
10
_module/nss/on_devcrit.nss
Normal file
10
_module/nss/on_devcrit.nss
Normal file
@ -0,0 +1,10 @@
|
||||
// on_devcrit.nss
|
||||
#include "nwnx_weapon"
|
||||
void main ()
|
||||
{
|
||||
NWNX_Weapon_BypassDevastatingCritical(); // bypass the normal devastating critical
|
||||
//if (!GetIsPC(OBJECT_SELF)) return; // this depends on what you want, on our server only PCs have dev crt
|
||||
// increase local var devcrit counter by 1 because the on_devcrit script
|
||||
// can run more than one time before the on_attack script runs
|
||||
SetLocalInt(OBJECT_SELF, "devcrit", GetLocalInt(OBJECT_SELF, "devcrit") + 1);
|
||||
}
|
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user