Здравствуйте соответсвующей темы не нашел по этому создал эту. Нужна помощь в освоении скриптинга Нвн 2, скажем для примера мне нужно изменить заклинание Призыв Баатезу, Чего я хочу там изменить, ну во первых чтобы существа призывались перманентно и не было пресловутых раундов времени зависящих от харизмы чернокнижника, Во вторых добавить еще существ для призыва. А в третьих собственно убрать рандом и сделать выбор кого призывать. Ниже сам скрипт заклинания. И еще чтобы существо не нападало на своего хозяина.//::///////////////////////////////////////////////
//:: Summon Baatezu
//:: NX2_SummonBaatezu.NSS
//:://////////////////////////////////////////////
/*
Summons a random demon to fight at your side.
c_summon_baatezu_erinyes - 29%
c_summon_baatezu_pitfiend - 10%
c_summon_baatezu_mephasm - 25%
c_summon_baatezu_neeshka - 5%
c_summon_baatezu_horneddevil - 30%
c_summon_baatezu_chicken - 1%
*/
//:://////////////////////////////////////////////
#include "x2_inc_spellhook"
////////////////////////////////////////////////
// CheckArea() - logic to see if the area is ok to go hostile
// make sure the devil doesn't respawn someplace
// like a city where the NPC's will freak out.
////////////////////////////////////////////////
int CheckArea(object oPC, object oAREA)
{
object oObject = GetFirstObjectInArea(oAREA);
while (oObject != OBJECT_INVALID)
{
if (GetObjectType(oObject) == OBJECT_TYPE_CREATURE)
{
if (GetIsReactionTypeHostile(oObject, oPC)) return TRUE;
}
oObject = GetNextObjectInArea(oAREA);
}
return FALSE;
}
////////////////////////////////////////////////
// CheckHostile() - logic to see if demon goes away or turns.
////////////////////////////////////////////////
void CheckHostile(object oPC, object oSUMMON, string sDEMON)
{
if (GetIsObjectValid(oSUMMON) == FALSE) return;
if (GetIsDead(oSUMMON) == TRUE) return;
int nRETURN;
object oAREA = GetArea(oPC);
RemoveSummonedAssociate(oPC, oSUMMON);
if (sDEMON == "c_summon_baatezu_neeshka") nRETURN = TRUE;
else if (sDEMON == "c_summon_baatezu_mephasm") nRETURN = TRUE;
else if (GetIsOverlandMap(oAREA)) nRETURN = TRUE;
else if (CheckArea(oPC, oAREA) == FALSE) nRETURN = TRUE;
if (nRETURN == TRUE)
{
DestroyObject(oSUMMON, 0.01);
FloatingTextStringOnCreature(GetName(oSUMMON)+ " " + GetStringByStrRef(233588), oPC, FALSE);
}
else
{
DelayCommand(0.01, ChangeToStandardFaction(oSUMMON, STANDARD_FACTION_HOSTILE));
FloatingTextStringOnCreature(GetName(oSUMMON)+ " " + GetStringByStrRef(233589), oPC, FALSE);
}
}
void CycleLevelup(object oSUMMON, int nSUM, int nCAP, int nCLASS_1, int nCLASS_2, int nCLASS_3, int nCLASS_4)
{
if (nSUM >= nCAP) return;
if (GetLevelByPosition(1, oSUMMON) < 40) LevelUpHenchman(oSUMMON, nCLASS_1, TRUE);
else if (GetLevelByPosition(2, oSUMMON) < 40) LevelUpHenchman(oSUMMON, nCLASS_2, TRUE);
else if (GetLevelByPosition(3, oSUMMON) < 40) LevelUpHenchman(oSUMMON, nCLASS_3, TRUE);
else if (GetLevelByPosition(4, oSUMMON) < 40) LevelUpHenchman(oSUMMON, nCLASS_4, TRUE);
else return;
DelayCommand(0.01, CycleLevelup(oSUMMON, nSUM + 1, nCAP, nCLASS_1, nCLASS_2, nCLASS_3, nCLASS_4));
}
void HWUpgradeSummon(object oPC, int nHW, string sDEMON, float fDUR)
{
object oSUMMON = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPC);
int nCLASS_1 = GetClassByPosition(1, oSUMMON);
int nCLASS_2 = GetClassByPosition(2, oSUMMON);
if (nCLASS_2 == CLASS_TYPE_INVALID) nCLASS_2 = CLASS_TYPE_FIGHTER;
int nCLASS_3 = CLASS_TYPE_BARD;
int nCLASS_4 = CLASS_TYPE_HARPER;
if (sDEMON == "c_summon_baatezu_neeshka")
{
nCLASS_3 = CLASS_TYPE_SWASHBUCKLER;
nCLASS_4 = CLASS_TYPE_DUELIST;
}
else if (sDEMON == "c_summon_baatezu_mephasm")
{
nCLASS_3 = CLASS_TYPE_DRUID;
nCLASS_4 = CLASS_TYPE_SPIRIT_SHAMAN;
}
else if (sDEMON == "c_summon_baatezu_horneddevil")
{
nCLASS_3 = CLASS_TYPE_RANGER;
nCLASS_4 = CLASS_TYPE_WEAPON_MASTER;
}
else if (sDEMON == "c_summon_baatezu_pitfiend")
{
nCLASS_3 = CLASS_TYPE_BARBARIAN;
nCLASS_4 = CLASS_TYPE_FRENZIEDBERSERKER;
}
else if (sDEMON == "c_summon_baatezu_erinyes")
{
nCLASS_3 = CLASS_TYPE_WARLOCK;
nCLASS_4 = CLASS_TYPE_FAVORED_SOUL;
}
int nCAP = GetHitDice(oPC);
int nSUM = GetHitDice(oSUMMON);
DelayCommand(0.01, CycleLevelup(oSUMMON, nSUM, nCAP, nCLASS_1, nCLASS_2, nCLASS_3, nCLASS_4));
// Delay the CheckHostile command until the "friendly" despawns.
DelayCommand(fDUR, CheckHostile(oPC, oSUMMON, sDEMON));
}
void main()
{
// If code within the PreSpellCastHook (i.e. UMD) reports FALSE, do not run this spell
if (!X2PreSpellCastCode()) return;
// Get Variables
object oPC = OBJECT_SELF;
int nHW = GetLevelByClass(CLASS_TYPE_HELLFIRE_WARLOCK, oPC);
if (nHW < 1) nHW = GetLevelByClass(CLASS_TYPE_WARLOCK, oPC);
// calculate rounds
int nROUNDS = nHW + GetAbilityModifier(ABILITY_CHARISMA, oPC) + d8();
float fDUR = RoundsToSeconds(nROUNDS);
// Choose Demon
string sDEMON = "c_summon_baatezu_chicken";
int nRANDOM = Random(100);
if (nRANDOM < 5) sDEMON = "c_summon_baatezu_neeshka";
else if (nRANDOM < 30) sDEMON = "c_summon_baatezu_mephasm";
else if (nRANDOM < 60) sDEMON = "c_summon_baatezu_horneddevil";
else if (nRANDOM < 70) sDEMON = "c_summon_baatezu_pitfiend";
else if (nRANDOM < 99) sDEMON = "c_summon_baatezu_erinyes";
// Summon the Creature
effect eSummon = EffectSummonCreature(sDEMON, VFX_FNF_SUMMON_UNDEAD);
eSummon = ExtraordinaryEffect(eSummon);
ApplyEffectAtLocation(DURATION_TYPE_PERMANENT, eSummon, GetSpellTargetLocation());
DelayCommand(0.01, HWUpgradeSummon(oPC, nHW, sDEMON, fDUR - 0.01));
}