177 lines
5.4 KiB
Plaintext
177 lines
5.4 KiB
Plaintext
// this script is from the vault and heavely modified by Tarashon.
|
|
|
|
|
|
const int MUTATE_CHANCE = 100; // percent
|
|
|
|
|
|
|
|
// Adds extra gold, hp, and attacks to creature, also makes it glow green.
|
|
void Mutate(object oMonster);
|
|
|
|
void main()
|
|
{
|
|
object oPC = GetEnteringObject();
|
|
|
|
// Added by tarashon to avoid chaintriggerring boost and loot effects on mobs allready spawned
|
|
|
|
if ( GetLocalInt(OBJECT_SELF, "DO_ONCE") )
|
|
return;
|
|
SetLocalInt(OBJECT_SELF, "DO_ONCE", TRUE);
|
|
DelayCommand(600.0, SetLocalInt(OBJECT_SELF, "DO_ONCE", FALSE));
|
|
|
|
// Tarashon safeguard end
|
|
|
|
// Only PC's can cause the mutate effect
|
|
if (!GetIsPC(oPC)) return;
|
|
|
|
// Mutation doesnt always happen
|
|
if (d100() > MUTATE_CHANCE) return;
|
|
|
|
// Get the nearest encounter creature and mutate it
|
|
string sRes = "";
|
|
int i = 1;
|
|
object oMonster = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, oPC, i);
|
|
while(GetIsObjectValid(oMonster))
|
|
{
|
|
if (GetIsEncounterCreature(oMonster))
|
|
{
|
|
Mutate(oMonster);
|
|
return;
|
|
}
|
|
i += 1;
|
|
oMonster = GetNearestCreature(CREATURE_TYPE_PLAYER_CHAR, PLAYER_CHAR_NOT_PC, oPC, i);
|
|
}
|
|
}
|
|
|
|
void Mutate(object oMonster)
|
|
{
|
|
|
|
ExecuteScript("",OBJECT_SELF);
|
|
|
|
// Name is Touched
|
|
// SetName(oMonster, "Touched " + GetName(oMonster));
|
|
|
|
// Touched glows yellow
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectVisualEffect(VFX_DUR_AURA_RED_LIGHT), oMonster);
|
|
|
|
// Touched is richer!
|
|
GiveGoldToCreature(oMonster, d10(FloatToInt(GetChallengeRating(oMonster))) * 10);
|
|
|
|
// Touched has 200% more Hit Points
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectTemporaryHitpoints(GetMaxHitPoints(oMonster)*1), oMonster);
|
|
|
|
// Touched has +6 STR
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAbilityIncrease(ABILITY_STRENGTH, 6), oMonster);
|
|
|
|
// Touched has +5 AC, by tarashon
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectACIncrease(5), oMonster);
|
|
|
|
// Touched has 20% concealment, by tarashon
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectConcealment(20), oMonster);
|
|
|
|
// Touched has SPell immunity Stonehold, by tarashon
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSpellImmunity(SPELL_STONEHOLD), oMonster);
|
|
|
|
// Touched has Spell immunity Flesh to Stone, by tarashon
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectSpellImmunity(SPELL_FLESH_TO_STONE), oMonster);
|
|
|
|
// Touched is immune to mind affecting spells
|
|
ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectImmunity(IMMUNITY_TYPE_MIND_SPELLS), oMonster);
|
|
|
|
CreateItemOnObject("touchedcaster", oMonster);
|
|
|
|
|
|
// monster have 50% chance of one aditional loot item.
|
|
|
|
// loot by tarashon *start*
|
|
|
|
string sItem;
|
|
int nRandom;
|
|
nRandom = Random(8) + 1;// Edit the number in () to how many cases. Leave +1
|
|
switch (nRandom)
|
|
{ // Put a case and the tag of each item to be spawned.
|
|
case 1: sItem = "keheal1"; break;
|
|
case 2: sItem = "keheal1"; break;
|
|
case 3: sItem = "it_mpotion011"; break;
|
|
case 4: sItem = "it_mpotion024"; break;
|
|
case 5: sItem = "it_mpotion020"; break;
|
|
case 6: sItem = "it_mpotion008"; break;
|
|
case 7: sItem = "goldseal1"; break;
|
|
case 8: sItem = "goldseal"; break;
|
|
|
|
default: break;
|
|
}
|
|
|
|
if (d100()<=50)
|
|
{
|
|
CreateItemOnObject(sItem, oMonster);//Creates the item into the monster.
|
|
}
|
|
|
|
// Loot by tarashon *end*
|
|
|
|
// Touched HAS 25% chance of being Furious, meaning hasted, slow+speeddecrease imune, +6 constitution and have extra loot, by tarashon
|
|
if (d100()<=25)
|
|
{
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectHaste(), oMonster);
|
|
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectImmunity(IMMUNITY_TYPE_MOVEMENT_SPEED_DECREASE), oMonster);
|
|
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectImmunity(IMMUNITY_TYPE_SLOW), oMonster);
|
|
|
|
// ApplyEffectToObject(DURATION_TYPE_PERMANENT, EffectAbilityIncrease(ABILITY_CONSTITUTION, 6), oMonster);
|
|
|
|
// Furious Touched is even richer
|
|
// GiveGoldToCreature(oMonster, d10(FloatToInt(GetChallengeRating(oMonster))) * 10);
|
|
|
|
// Adds Furious to the monster name making it "Furious Touched xxx"
|
|
// SetName(oMonster, " Furious " + GetName(oMonster));
|
|
|
|
// loot if hasted by tarashon *start*
|
|
|
|
string sItem;
|
|
int nRandom;
|
|
nRandom = Random(8) + 1;// Edit the number in () to how many cases. Leave +1
|
|
switch (nRandom)
|
|
{ // Put a case and the tag of each item to be spawned.
|
|
case 1: sItem = "keheal1"; break;
|
|
case 2: sItem = "keheal1"; break;
|
|
case 3: sItem = "it_mpotion011"; break;
|
|
case 4: sItem = "it_mpotion024"; break;
|
|
case 5: sItem = "it_mpotion020"; break;
|
|
case 6: sItem = "it_mpotion008"; break;
|
|
case 7: sItem = "goldseal1"; break;
|
|
case 8: sItem = "goldseal"; break;
|
|
|
|
default: break;
|
|
}
|
|
CreateItemOnObject(sItem, oMonster); // Creates item from new table on monster.
|
|
CreateItemOnObject(sItem, oMonster); // Creates item from new table on monster.
|
|
|
|
// ekstra chance of extra item.
|
|
if (d100()<=50)
|
|
{
|
|
CreateItemOnObject(sItem, oMonster);//Creates another of the item into the monster.
|
|
}
|
|
|
|
// ekstra chance of extra item.
|
|
if (d100()<=50)
|
|
{
|
|
CreateItemOnObject(sItem, oMonster);//Creates another of the item into the monster.
|
|
}
|
|
|
|
}
|
|
|
|
// loot if hasted by tarashon *end*
|
|
|
|
|
|
// Touched has 1 extra attack
|
|
int iBAB = GetBaseAttackBonus(oMonster) + 1;
|
|
if (iBAB > 6) return;
|
|
SetBaseAttackBonus(iBAB, oMonster);
|
|
|
|
}
|
|
|
|
///
|
|
|
|
|