effect eEffect; location lTarget; object oTarget; //Created by Guile 3/12/07 //Put this on action taken in the conversation editor #include "nw_i0_tool" void RemoveXPFromParty(int nXP, object oPC, int bAllParty=TRUE) { if (!bAllParty) { nXP=(GetXP(oPC)-nXP)>=0 ? GetXP(oPC)-nXP : 0; SetXP(oPC, nXP); } else { object oMember=GetFirstFactionMember(oPC, TRUE); while (GetIsObjectValid(oMember)) { nXP=(GetXP(oMember)-nXP)>=0 ? GetXP(oMember)-nXP : 0; SetXP(oMember, nXP); oMember=GetNextFactionMember(oPC, TRUE); } } } void main() { object oPC = GetPCSpeaker(); int nInt; nInt = d20(); if (nInt==1) { oTarget = GetWaypointByTag("wheelway1"); lTarget = GetLocation(oTarget); //only do the jump if the location is valid. //though not flawless, we just check if it is in a valid area. //the script will stop if the location isn't valid - meaning that //nothing put after the teleport will fire either. //the current location won't be stored, either if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; AssignCommand(oPC, ClearAllActions()); DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); oTarget = oPC; //Visual effects can't be applied to waypoints, so if it is a WP //the VFX will be applied to the WP's location instead nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); FloatingTextStringOnCreature("You have been teleported to another plane of existence!", oPC); } else if (nInt==2) { RewardPartyXP(50000, oPC, FALSE); FloatingTextStringOnCreature("You have gained much knowlege about your abilities.", oPC); } else if (nInt==2) { RewardPartyGP(500000, oPC, FALSE); FloatingTextStringOnCreature("You pockets are overloaded with Gold!", oPC); } else if (nInt==4) { CreateItemOnObject("wheelitem1", oPC); } else if (nInt==5) { oTarget = oPC; eEffect = EffectCutsceneGhost(); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectMovementSpeedIncrease(30); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectConcealment(70); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectSpellResistanceIncrease(70); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); SendMessageToPC(oPC, "You are temporarially empowered with Godly Powers!"); } else if (nInt==6) { nInt=GetGold(oPC); AssignCommand(oPC, TakeGoldFromCreature(nInt, oPC, TRUE)); FloatingTextStringOnCreature("All of your gold has been turned to lead!", oPC); } else if (nInt==7) { CreateItemOnObject("wheelitem5", oPC); FloatingTextStringOnCreature("You found an Ancient Artfact!", oPC); } else if (nInt==8) { oTarget = oPC; eEffect = EffectCurse(6, 6, 6, 6, 6, 6); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectDeaf(); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectSlow(); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectSavingThrowDecrease(SAVING_THROW_ALL, 12, SAVING_THROW_TYPE_ALL); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); FloatingTextStringOnCreature("You have been bestowed with a vile curse!!!!!", oPC); } else if (nInt==9) { RemoveXPFromParty(30000, oPC, FALSE); FloatingTextStringOnCreature("You have lost a lot of memories and experiences!!!!!", oPC); } else if (nInt==10) { CreateItemOnObject("wheelitem6", oPC); FloatingTextStringOnCreature("You found a strange item!", oPC); } else if (nInt==11) { RewardPartyXP(20000, oPC, FALSE); FloatingTextStringOnCreature("You have gained vast knowled you never knew you had!!!", oPC); } else if (nInt==13) { oTarget = oPC; eEffect = EffectDeath(); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); FloatingTextStringOnCreature("Your heart has stopped beating!!!!!", oPC); } else if (nInt==14) { RewardPartyGP(2000000, oPC, FALSE); FloatingTextStringOnCreature("Your pockets are overflowing with gold!!!!!!!", oPC); } else if (nInt==15) { object oPC = GetPCSpeaker(); object oTarget; oTarget = oPC; effect eEffect; eEffect = EffectDeath(); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); ActionCastSpellAtObject(SPELL_IMPLOSION, oTarget, METAMAGIC_ANY, TRUE, 36, PROJECTILE_PATH_TYPE_DEFAULT, FALSE); FloatingTextStringOnCreature("Someone or Something has cast an evil spell at you!!!!", oPC); } else if (nInt==16) { oTarget = GetWaypointByTag("wheelway2"); lTarget = GetLocation(oTarget); //only do the jump if the location is valid. //though not flawless, we just check if it is in a valid area. //the script will stop if the location isn't valid - meaning that //nothing put after the teleport will fire either. //the current location won't be stored, either if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; AssignCommand(oPC, ClearAllActions()); DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); oTarget = oPC; //Visual effects can't be applied to waypoints, so if it is a WP //the VFX will be applied to the WP's location instead nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); FloatingTextStringOnCreature("You have been teleported to another plane of existence!", oPC); } else if (nInt==17) { RewardPartyXP(20000, oPC, FALSE); RewardPartyGP(2000000, oPC, FALSE); FloatingTextStringOnCreature("It seems fortune has finally found you!!!.", oPC); } else if (nInt==18) { oTarget = oPC; eEffect = EffectAttackIncrease(10); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectDamageIncrease(DAMAGE_BONUS_2d12, DAMAGE_TYPE_POSITIVE); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectDamageIncrease(DAMAGE_BONUS_2d12, DAMAGE_TYPE_DIVINE); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectACIncrease(10); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectConcealment(65); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); //Visual effects can't be applied to waypoints, so if it is a WP //the VFX will be applied to the WP's location instead nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_MAGIC_PROTECTION), GetLocation(oTarget)); //Visual effects can't be applied to waypoints, so if it is a WP //the VFX will be applied to the WP's location instead nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_MASS_HEAL), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_FNF_MASS_HEAL), GetLocation(oTarget)); SendMessageToPC(oPC, "You have been temporarially endowed with great power!!!"); } else if (nInt==19) { oTarget = oPC; eEffect = EffectPolymorph(POLYMORPH_TYPE_IRON_GOLEM); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); FloatingTextStringOnCreature("You have been polymorphed into a golem!!!!", oPC); eEffect = EffectDamageImmunityIncrease(DAMAGE_TYPE_BLUDGEONING, 100); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 100); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); eEffect = EffectDamageImmunityIncrease(DAMAGE_TYPE_SLASHING, 100); eEffect = SupernaturalEffect(eEffect); ApplyEffectToObject(DURATION_TYPE_PERMANENT, eEffect, oTarget); } else if (nInt==20) { AssignCommand(oPC, ClearAllActions()); lTarget = GetLocalLocation(oPC, "ls_stored_loc"); //only do the jump if the location is valid. //though not flawless, we just check if it is in a valid area. //the script will stop if the location isn't valid - meaning that //nothing put after the teleport will fire either. //the current location won't be stored, either if (GetAreaFromLocation(lTarget)==OBJECT_INVALID) return; AssignCommand(oPC, ClearAllActions()); DelayCommand(3.0, AssignCommand(oPC, ActionJumpToLocation(lTarget))); oTarget = oPC; //Visual effects can't be applied to waypoints, so if it is a WP //the VFX will be applied to the WP's location instead nInt = GetObjectType(oTarget); if (nInt != OBJECT_TYPE_WAYPOINT) ApplyEffectToObject(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), oTarget); else ApplyEffectAtLocation(DURATION_TYPE_INSTANT, EffectVisualEffect(VFX_IMP_UNSUMMON), GetLocation(oTarget)); FloatingTextStringOnCreature("You have been teleported somewhere familiar!!!!", oPC); } }