generated from Jaysyn/ModuleTemplate
Initial Commit
Initial Commit
This commit is contained in:
232
_module/nss/monster_bye.nss
Normal file
232
_module/nss/monster_bye.nss
Normal file
@@ -0,0 +1,232 @@
|
||||
#include "spawner"
|
||||
#include "x0_i0_petrify"
|
||||
#include "eradicate"
|
||||
|
||||
void main()
|
||||
{
|
||||
object oPC = GetLastUsedBy();
|
||||
object oTarget;
|
||||
object oMod = GetModule();
|
||||
object oSpawner;
|
||||
object oDeath = GetObjectByTag("reaper");
|
||||
effect eEffect= EffectDeath();
|
||||
object oP1 = GetObjectByTag("pool1");
|
||||
object oP2 = GetObjectByTag("pool2");
|
||||
object oP3 = GetObjectByTag("fountain1");
|
||||
object oP4 = GetObjectByTag("fountain2");
|
||||
object oLever1 = GetObjectByTag("pool_lever");
|
||||
object oLever2 = GetObjectByTag("fount_lever");
|
||||
object oMonster;
|
||||
effect eEffect2 = EffectVisualEffect(VFX_DUR_GLOBE_INVULNERABILITY);
|
||||
int oMode = GetLocalInt(oMod, "duel_on");
|
||||
int iHwar = GetLocalInt(oMod, "hwar_on");
|
||||
int iTurnFlag = GetLocalInt(oMod, "turn_flag");
|
||||
int iJoinSwitch = GetLocalInt(oPC, "join_switch");
|
||||
int iConfirm = GetLocalInt(oPC, "bet_confirmed");
|
||||
int iWarWon = GetLocalInt(oMod, "war_won");
|
||||
int iTLwager = GetLocalInt(oPC, "TLwager");
|
||||
int iWager = GetLocalInt(oPC, "wager");
|
||||
int mCount=0;
|
||||
int iHappy = GetLocalInt(oPC, "iHappy");
|
||||
|
||||
if ((iConfirm==1)&&(iWarWon!=1))
|
||||
{
|
||||
iTLwager+=iWager;
|
||||
SetLocalInt(oPC, "TLwager", iTLwager);
|
||||
Message(5.0, "** You have forfeited the bet **", oPC);
|
||||
SetLocalInt(oPC, "bet_confirmed", 0);
|
||||
}
|
||||
|
||||
|
||||
//FloatingTextStringOnCreature(IntToString(GetLocalInt(oMod, "hwar_on")), oPC);
|
||||
//FloatingTextStringOnCreature(IntToString(GetLocalInt(oPC, "join_switch")), oPC);
|
||||
//FloatingTextStringOnCreature(IntToString(GetLocalInt(oMod, "turn_flag")), oPC);
|
||||
|
||||
if ((iHwar==1)&&(iTurnFlag!=1)&&(iJoinSwitch==1))
|
||||
{
|
||||
PlaySound("gui_select");
|
||||
SetLocalInt(oMod, "xcheck", 1);
|
||||
SetLocalInt(oMod, "challenge", 0);
|
||||
SetLocalInt(oMod, "d1", 0);
|
||||
SetLocalInt(oMod, "d2", 0);
|
||||
SetLocalInt(oMod, "d2a", 0);
|
||||
SetLocalInt(oMod, "d3", 0);
|
||||
SetLocalInt(oMod, "d4", 0);
|
||||
SetLocalInt(oMod, "d5", 0);
|
||||
SetLocalInt(oMod, "ch_hw", 0);
|
||||
SetLocalInt(oMod, "ch_dr", 0);
|
||||
SetLocalInt(oMod, "ch_bl", 0);
|
||||
SetLocalInt(oMod, "ch_pf", 0);
|
||||
SetLocalInt(oMod, "ch_df", 0);
|
||||
SetLocalInt(oMod, "ch_pm", 0);
|
||||
SetLocalInt(oMod, "ch_bm", 0);
|
||||
SetLocalInt(oMod, "ch_lm", 0);
|
||||
SetLocalInt(oMod, "ch_ll", 0);
|
||||
SetLocalInt(oMod, "ch_xx", 0);
|
||||
SetLocalInt(oMod, "gr_xx", 0);
|
||||
SetLocalInt(oMod, "sw_hw", 0);
|
||||
SetLocalInt(oMod, "sw_dr", 0);
|
||||
SetLocalInt(oMod, "sw_bl", 0);
|
||||
SetLocalInt(oMod, "sw_pf", 0);
|
||||
SetLocalInt(oMod, "sw_df", 0);
|
||||
SetLocalInt(oMod, "sw_pm", 0);
|
||||
SetLocalInt(oMod, "sw_bm", 0);
|
||||
SetLocalInt(oMod, "sw_lm", 0);
|
||||
SetLocalInt(oMod, "sw_ll", 0);
|
||||
SetLocalInt(oMod, "sw_xx", 0);
|
||||
SetLocalInt(oPC, "champ_won", 0);
|
||||
SetLocalInt(oMod, "war_won", 1);
|
||||
Eradicate(oPC);
|
||||
oSpawner = GetObjectByTag("spawner");
|
||||
AssignCommand(oSpawner, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
}
|
||||
else
|
||||
{
|
||||
object oLast = GetFirstObjectInArea(GetArea(oPC));
|
||||
while (GetIsObjectValid(oLast))
|
||||
{
|
||||
if ((GetObjectType(oLast)==OBJECT_TYPE_CREATURE)&&(!GetIsPC(oLast))&&
|
||||
(!GetIsDead(oLast))&&(GetTag(oLast)!="reaper")&&(GetTag(oLast)!="starfall"))
|
||||
{
|
||||
++mCount;
|
||||
//FloatingTextStringOnCreature(GetName(oLast), oPC);
|
||||
}
|
||||
if ((GetTag(oLast)=="starfall")&&(GetIsEnemy(oLast, oPC)))
|
||||
{
|
||||
++mCount;
|
||||
}
|
||||
oLast = GetNextObjectInArea(GetArea(oPC));
|
||||
}
|
||||
if (mCount!=0)
|
||||
{
|
||||
//FloatingTextStringOnCreature(IntToString(mCount), oPC);
|
||||
if (iHappy==1)
|
||||
{PlaySound("gui_select");}
|
||||
else
|
||||
{PlaySound("sce_negative");}
|
||||
SetLocalInt(oMod, "xcheck", 1);
|
||||
SetLocalInt(oMod, "challenge", 0);
|
||||
SetLocalInt(oMod, "d1", 0);
|
||||
SetLocalInt(oMod, "d2", 0);
|
||||
SetLocalInt(oMod, "d2a", 0);
|
||||
SetLocalInt(oMod, "d3", 0);
|
||||
SetLocalInt(oMod, "d4", 0);
|
||||
SetLocalInt(oMod, "d5", 0);
|
||||
SetLocalInt(oMod, "ch_hw", 0);
|
||||
SetLocalInt(oMod, "ch_dr", 0);
|
||||
SetLocalInt(oMod, "ch_bl", 0);
|
||||
SetLocalInt(oMod, "ch_pf", 0);
|
||||
SetLocalInt(oMod, "ch_df", 0);
|
||||
SetLocalInt(oMod, "ch_pm", 0);
|
||||
SetLocalInt(oMod, "ch_bm", 0);
|
||||
SetLocalInt(oMod, "ch_lm", 0);
|
||||
SetLocalInt(oMod, "ch_ll", 0);
|
||||
SetLocalInt(oMod, "ch_xx", 0);
|
||||
SetLocalInt(oMod, "gr_xx", 0);
|
||||
SetLocalInt(oMod, "sw_hw", 0);
|
||||
SetLocalInt(oMod, "sw_dr", 0);
|
||||
SetLocalInt(oMod, "sw_bl", 0);
|
||||
SetLocalInt(oMod, "sw_pf", 0);
|
||||
SetLocalInt(oMod, "sw_df", 0);
|
||||
SetLocalInt(oMod, "sw_pm", 0);
|
||||
SetLocalInt(oMod, "sw_bm", 0);
|
||||
SetLocalInt(oMod, "sw_lm", 0);
|
||||
SetLocalInt(oMod, "sw_ll", 0);
|
||||
SetLocalInt(oMod, "sw_xx", 0);
|
||||
SetLocalInt(oMod, "hwar_on", 0);
|
||||
if (oMode==1)
|
||||
{
|
||||
PlaySound("sps_darkness");
|
||||
SetIsTemporaryFriend(oPC, GetObjectByTag("starfall"));
|
||||
object oTarget2 = GetObjectByTag("starfall");
|
||||
location oLoc = GetLocation(oTarget2);
|
||||
int iDied = GetLocalInt (oPC,"iDied");
|
||||
++iDied;
|
||||
SetLocalInt(oPC,"iDied",iDied);
|
||||
FloatingTextStringOnCreature("You have surrendered and lost the duel", oPC);
|
||||
SetLocked(GetObjectByTag("arena_gate"), FALSE);
|
||||
AssignCommand(oLever1, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
AssignCommand(oLever2, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
RemoveEffectOfType(oP1, GetEffectType(eEffect2));
|
||||
RemoveEffectOfType(oP2, GetEffectType(eEffect2));
|
||||
RemoveEffectOfType(oP3, GetEffectType(eEffect2));
|
||||
RemoveEffectOfType(oP4, GetEffectType(eEffect2));
|
||||
SetLocalInt(oMod, "fountain_state", 0);
|
||||
SetLocalInt(oMod, "pool_state", 0);
|
||||
SetIsTemporaryFriend(oPC, GetObjectByTag("starfall"));
|
||||
DelayCommand(0.1, AssignCommand(oTarget2, ClearAllActions()));
|
||||
DelayCommand(1.9, AssignCommand
|
||||
(GetObjectByTag("starfall"), ActionSpeakString("You are wise to surrender, mortal",TALKVOLUME_SHOUT)));
|
||||
DelayCommand(2.0, AssignCommand
|
||||
(GetObjectByTag("starfall"), ActionPlayAnimation(ANIMATION_FIREFORGET_BOW)));
|
||||
DelayCommand(4.0, AssignCommand
|
||||
(GetObjectByTag("starfall"), ActionSpeakString("You know where to find me if you wish to try again.",TALKVOLUME_SHOUT)));
|
||||
DelayCommand(7.0, AssignCommand
|
||||
(oTarget2, ActionPlayAnimation(ANIMATION_FIREFORGET_VICTORY2)));
|
||||
DelayCommand(8.5, ApplyEffectAtLocation(DURATION_TYPE_INSTANT,
|
||||
EffectVisualEffect(VFX_IMP_REMOVE_CONDITION), oLoc));
|
||||
DelayCommand(9.0, AssignCommand
|
||||
(oTarget2, JumpToLocation(GetLocation(GetObjectByTag ("starfall_wp")))));
|
||||
SetLocalInt(oMod, "duel_on",0);
|
||||
DelayCommand(9.2, Cast(SPELL_GREATER_RESTORATION, oTarget2));
|
||||
DelayCommand(9.5, RemoveEffectOfType(oTarget2, EFFECT_TYPE_CONCEALMENT));
|
||||
}
|
||||
else
|
||||
{
|
||||
SetLocalInt(oMod, "xcheck", 1);
|
||||
SetLocalInt(oMod, "challenge", 0);
|
||||
SetLocalInt(oMod, "d1", 0);
|
||||
SetLocalInt(oMod, "d2", 0);
|
||||
SetLocalInt(oMod, "d2a", 0);
|
||||
SetLocalInt(oMod, "d3", 0);
|
||||
SetLocalInt(oMod, "d4", 0);
|
||||
SetLocalInt(oMod, "d5", 0);
|
||||
SetLocalInt(oMod, "ch_hw", 0);
|
||||
SetLocalInt(oMod, "ch_dr", 0);
|
||||
SetLocalInt(oMod, "ch_bl", 0);
|
||||
SetLocalInt(oMod, "ch_pf", 0);
|
||||
SetLocalInt(oMod, "ch_df", 0);
|
||||
SetLocalInt(oMod, "ch_pm", 0);
|
||||
SetLocalInt(oMod, "ch_bm", 0);
|
||||
SetLocalInt(oMod, "ch_lm", 0);
|
||||
SetLocalInt(oMod, "ch_ll", 0);
|
||||
SetLocalInt(oMod, "ch_xx", 0);
|
||||
SetLocalInt(oMod, "gr_xx", 0);
|
||||
SetLocalInt(oMod, "sw_hw", 0);
|
||||
SetLocalInt(oMod, "sw_dr", 0);
|
||||
SetLocalInt(oMod, "sw_bl", 0);
|
||||
SetLocalInt(oMod, "sw_pf", 0);
|
||||
SetLocalInt(oMod, "sw_df", 0);
|
||||
SetLocalInt(oMod, "sw_pm", 0);
|
||||
SetLocalInt(oMod, "sw_bm", 0);
|
||||
SetLocalInt(oMod, "sw_lm", 0);
|
||||
SetLocalInt(oMod, "sw_ll", 0);
|
||||
SetLocalInt(oMod, "sw_xx", 0);
|
||||
SetLocalInt(oMod, "hwar_on", 0);
|
||||
AssignCommand(oLever1, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
AssignCommand(oLever2, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
RemoveEffectOfType(oP1, GetEffectType(eEffect2));
|
||||
RemoveEffectOfType(oP2, GetEffectType(eEffect2));
|
||||
RemoveEffectOfType(oP3, GetEffectType(eEffect2));
|
||||
RemoveEffectOfType(oP4, GetEffectType(eEffect2));
|
||||
SetLocalInt(oMod, "fountain_state", 0);
|
||||
SetLocalInt(oMod, "pool_state", 0);
|
||||
SetLocked(GetObjectByTag("arena_gate"), FALSE);
|
||||
SetLocalInt(oMod, "hwar_on", 0);
|
||||
SetLocalInt(oMod, "scre2_state", 0);
|
||||
SetLocalInt(oMod, "scre_state", 0);
|
||||
SetLocalInt(oMod, "scre_state3", 0);
|
||||
SetLocalInt(oMod, "scre_state4", 0);
|
||||
Eradicate(oPC);
|
||||
}
|
||||
oSpawner = GetObjectByTag("spawner");
|
||||
AssignCommand(oSpawner, ActionPlayAnimation(ANIMATION_PLACEABLE_DEACTIVATE));
|
||||
}
|
||||
else
|
||||
{
|
||||
PlaySound("sim_cntresist");
|
||||
FloatingTextStringOnCreature("** No enemies present **", oPC);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user