Skip to content

Commit

Permalink
Isle of the maker golem fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Logg-y committed Nov 2, 2024
1 parent da4dc09 commit 20d0415
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 17 deletions.
22 changes: 15 additions & 7 deletions src/nss/death_makerbgol.nss
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,21 @@ void MakeNewGolem(object oOne, object oTwo, location lMid)
// Remove old ones from array
if (GetIsObjectValid(oOne))
{
int nIndex = JsonGetInt(JsonFind(jGolems, JsonString(ObjectToString(oOne))));
jGolems = JsonArrayDel(jGolems, nIndex);
json jResponse = JsonFind(jGolems, JsonString(ObjectToString(oOne)));
if (jResponse != JsonNull())
{
int nIndex = JsonGetInt(jResponse);
jGolems = JsonArrayDel(jGolems, nIndex);
}
}
if (GetIsObjectValid(oTwo))
{
int nIndex = JsonGetInt(JsonFind(jGolems, JsonString(ObjectToString(oTwo))));
jGolems = JsonArrayDel(jGolems, nIndex);
json jResponse = JsonFind(jGolems, JsonString(ObjectToString(oTwo)));
if (jResponse != JsonNull())
{
int nIndex = JsonGetInt(jResponse);
jGolems = JsonArrayDel(jGolems, nIndex);
}
}

SetLocalJson(oArea, "maker_golems", jGolems);
Expand All @@ -48,12 +56,12 @@ void main()
return;
}
// Look for another dead one
int n=1;
int n=0;
object oOther;
do
{
object oOther = GetNearestObjectByTag(GetTag(OBJECT_SELF), OBJECT_SELF, n);
if (GetIsDead(oOther) && GetIsObjectValid(oOther))
oOther = GetNearestObjectByTag(GetTag(OBJECT_SELF), OBJECT_SELF, n);
if (GetIsDead(oOther) && GetIsObjectValid(oOther) && oOther != OBJECT_SELF)
{
if (!GetLocalInt(oOther, "tethering"))
{
Expand Down
21 changes: 12 additions & 9 deletions src/nss/dlg_buff.nss
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,17 @@ void main()

if (GetIsDeveloper(oPC))
{
SendDiscordLogMessage(GetName(oPC) + " used the developer menu to apply various OP buffs to themselves, permanently.");
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAttackIncrease(20), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectDamageIncrease(30), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectMovementSpeedIncrease(99), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectTemporaryHitpoints(200), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectHaste(), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSkillIncrease(SKILL_SEARCH, 50), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSkillIncrease(SKILL_LORE, 50), oPC);
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSkillIncrease(SKILL_PERSUADE, 50), oPC);
SendDiscordLogMessage(GetName(oPC) + " used the developer menu to apply various OP buffs to themselves.");
effect eLink = EffectAttackIncrease(20);
eLink = EffectLinkEffects(eLink, EffectDamageIncrease(30));
eLink = EffectLinkEffects(eLink, EffectDamageImmunityIncrease(4095, 90));
eLink = EffectLinkEffects(eLink, EffectSpellResistanceIncrease(28));
eLink = EffectLinkEffects(eLink, EffectMovementSpeedIncrease(99));
eLink = EffectLinkEffects(eLink, EffectTemporaryHitpoints(200));
eLink = EffectLinkEffects(eLink, EffectHaste());
eLink = EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_SEARCH, 50));
eLink = EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_LORE, 50));
eLink = EffectLinkEffects(eLink, EffectSkillIncrease(SKILL_PERSUADE, 50));
ApplyEffectToObject(DURATION_TYPE_TEMPORARY, SupernaturalEffect(eLink), oPC, 3600.0);
}
}
9 changes: 8 additions & 1 deletion src/nss/hb_maker.nss
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,13 @@ void main()
int nDR = 0;
int nHP = GetCurrentHitPoints();
int nLastHP = GetLocalInt(OBJECT_SELF, "last_hp");
if (nLastHP == 0)
nLastHP = GetMaxHitPoints();
int nLastDR = GetLocalInt(OBJECT_SELF, "last_dr");
effect eTest = GetFirstEffect(OBJECT_SELF);
while (GetIsEffectValid(eTest))
{
if (GetEffectType(eTest) == EFFECT_TYPE_DAMAGE_REDUCTION)
if (GetEffectType(eTest) == EFFECT_TYPE_DAMAGE_RESISTANCE)
{
nDR += GetEffectInteger(eTest, 2);
}
Expand All @@ -95,6 +97,8 @@ void main()
if (nHPDelta <= 0) { nHPDelta = 0; }
int nDRDelta = nLastDR - nDR;
if (nDRDelta <= 0) { nDRDelta = 0; }

//SpeakString("HP delta " + IntToString(nHPDelta) + " DR delta " + IntToString(nDRDelta) + ", current values " + IntToString(nHP) + " " + IntToString(nDR));

// This is deliberately built to make doing damage
// to the maker rapidly cause him to be more inclined to make golems
Expand All @@ -107,10 +111,13 @@ void main()
// Actual HP damage counts for more
// Dispelling premonition/stoneskin will count as a massive damage spike...
int nEHPDelta = nHPDelta*2 + nDRDelta;


int nGolemPoints = FloatToInt(pow(IntToFloat(nEHPDelta), 1.4));
int nOldGolemPoints = GetLocalInt(OBJECT_SELF, "golem_points");
nGolemPoints += nOldGolemPoints;
nGolemPoints += 4;
//SpeakString("Golem points: " + IntToString(nGolemPoints));
float fDelay = 0.0;
while (nGolemPoints > 400)
{
Expand Down

0 comments on commit 20d0415

Please sign in to comment.