Neverwinter Script Source
//:://////////////////////////////////////////////
//:: OnUserDefaine am_cud_methan
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
Стандартный UserDefaine скрипт
*/
//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 09.07.2005
//:://///////////////////////////////////////////
//#include "am_inc_battle"
//#include "am_inc_common"
//#include "am_inc_cutscene"
int GetIsAssociate(object oMaster, object oAssociate)
{
object oMaster = GetMaster(oAssociate);
if(oMaster != OBJECT_INVALID)
{
return TRUE;
}
return FALSE;
}
void ClearAllPersonalReputation(object oMaster, object oSource=OBJECT_SELF, int iClearAllActions = FALSE)
{
object oAnimal = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oMaster);
object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oMaster);
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oMaster);
object oSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster);
if(iClearAllActions = TRUE)
AssignCommand(oMaster,ClearAllActions(TRUE));
ClearPersonalReputation(oMaster, oSource);
if(oAnimal != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oAnimal,ClearAllActions(TRUE));
ClearPersonalReputation(oAnimal, oSource);
}
if(oDominated != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oDominated,ClearAllActions(TRUE));
ClearPersonalReputation(oDominated, oSource);
}
if(oFamiliar != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oFamiliar,ClearAllActions(TRUE));
ClearPersonalReputation(oFamiliar, oSource);
}
if(oSummoned != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oSummoned,ClearAllActions(TRUE));
ClearPersonalReputation(oSummoned, oSource);
}
int i = 1;
object oHenchman = GetHenchman(oMaster, i);
while(oHenchman != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oHenchman,ClearAllActions(TRUE));
ClearPersonalReputation(oHenchman, oSource);
i++;
oHenchman = GetHenchman(oMaster, i);
}
}
void FreezeCompanion(object oPlayers, int bVanish=FALSE)
{
effect eAssociate = EffectCutsceneParalyze();
effect eInv = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
int i = 1;
object oHench = GetHenchman(oPlayers, i);
while(oHench != OBJECT_INVALID)
{
AssignCommand(oHench,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oHench));
if(bVanish==TRUE){
AssignCommand(oHench,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oHench));}
i++;
oHench = GetHenchman(oPlayers, i);
}
object oCompanion = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPlayers);
if (oCompanion != OBJECT_INVALID)
{
AssignCommand(oCompanion,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oCompanion));
if(bVanish==TRUE){
AssignCommand(oCompanion,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oCompanion));}
}
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPlayers);
if (oFamiliar != OBJECT_INVALID)
{
AssignCommand(oFamiliar,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oFamiliar));
if(bVanish==TRUE){
AssignCommand(oFamiliar,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oFamiliar));}
}
object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPlayers);
if (oSummon != OBJECT_INVALID)
{
AssignCommand(oSummon,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oSummon));
if(bVanish==TRUE){
AssignCommand(oSummon,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oSummon));}
}
object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPlayers);
if (oDominated != OBJECT_INVALID)
{
AssignCommand(oDominated,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oDominated));
if(bVanish==TRUE){
AssignCommand(oDominated,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oDominated));}
}
}
void RemoveingBadEffectForCut(object oCreature)
{
effect eBad = GetFirstEffect(oCreature);
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_POISON ||
GetEffectType(eBad) == EFFECT_TYPE_SLOW ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
RemoveEffect(oCreature, eBad);
}
eBad = GetNextEffect(oCreature);
}
//Fire cast spell at event for the specified target
SignalEvent(oCreature, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
}
void CutsceneOn(object oPlayers)
{
if(GetCutsceneMode(oPlayers) == FALSE)
{
RemoveingBadEffectForCut(oPlayers);
SetLocalInt(oPlayers, "CUTSCENEMOD", TRUE);
SetCutsceneMode(oPlayers, TRUE);
}
}
void ChangeEnemyToNetral(object oPlayer, object oNetral)
{
object oArea = GetArea(oPlayer);
object oEnemy = GetFirstObjectInArea(oArea);
object oAnimal = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPlayer);
object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPlayer);
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPlayer);
object oSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPlayer);
effect eEffect = EffectVisualEffect(VFX_IMP_UNSUMMON);
while (GetIsObjectValid(oEnemy))
{
if (GetIsEnemy(oPlayer,oEnemy))
{
/*
//------------------------------------------------------------------------------
// Если пойдет что-то не так. Будут жалобы игроков, то помощников НПС буду удалять...
//------------------------------------------------------------------------------
int iNum = 1;
while(iNum < 6)
{
object oAssociate = GetAssociate(iNum, oEnemy);
if(GetIsObjectValid(oAssociate))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oAssociate);
DestroyObject(oAssociate, 0.5);
}
iNum++;
}
*/
//----------------------- Обработка помощников игрока -------------------------//
if(oAnimal != OBJECT_INVALID) {
AssignCommand(oAnimal,ClearAllActions(TRUE));
ClearPersonalReputation(oAnimal,oEnemy);}
if(oDominated != OBJECT_INVALID){
AssignCommand(oDominated,ClearAllActions(TRUE));
ClearPersonalReputation(oDominated,oEnemy);}
if(oFamiliar != OBJECT_INVALID){
AssignCommand(oFamiliar,ClearAllActions(TRUE));
ClearPersonalReputation(oFamiliar,oEnemy);}
if(oSummoned != OBJECT_INVALID){
AssignCommand(oSummoned,ClearAllActions(TRUE));
ClearPersonalReputation(oSummoned,oEnemy);}
int i = 1;
object oHench = GetHenchman(oPlayer, i);
while(oHench != OBJECT_INVALID)
{
AssignCommand(oHench,ClearAllActions(TRUE));
ClearPersonalReputation(oHench,oEnemy);
i++;
oHench = GetHenchman(oPlayer, i);
}
AssignCommand(oEnemy,ClearAllActions(TRUE));
ClearPersonalReputation(oPlayer,oEnemy);
ChangeFaction(oEnemy,oNetral);
}
oEnemy = GetNextObjectInArea(oArea);
}
}
void main()
{
int nEvent = GetUserDefinedEventNumber();
object oPC = GetFirstPC();
object oSelf = OBJECT_SELF;
object oAlishan = GetObjectByTag("AM_HEN_ALISHAN");
object oNeytral = GetObjectByTag("GLOBAL_TRUE_NEUTRAL");
if (GetIsDead(OBJECT_SELF)==TRUE) return; // Если он помер, то пусть молчит
if (GetArea(OBJECT_SELF)!=GetArea(GetFirstPC())) return;
if (GetImmortal(OBJECT_SELF) == FALSE) return;
if(!GetLocalInt(oSelf, "METHAN_BATTLE_PC")) return;
//=========================== HEARTBEAT EVENT ==================================
if (nEvent == EVENT_HEARTBEAT) // Сигнал поступает User Defined Event 1001
{
int iCurHP = GetCurrentHitPoints(oSelf); // Количество поинтов максимум о Нпс
if(!GetLocalInt(oSelf, "HIT_POINTS"))
{
if (iCurHP <= 15)
{
CutsceneOn(oPC);
FreezeCompanion(oPC);
SetLocalInt(oSelf, "HIT_POINTS", TRUE);
SetLocalInt(oSelf, "REPEAT", TRUE);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oSelf, ClearAllActions(TRUE));
AssignCommand(oAlishan, ClearAllActions(TRUE));
ChangeEnemyToNetral(oPC, oNeytral);
ClearAllPersonalReputation(oPC, oSelf, TRUE);
if(GetIsAssociate(oPC, oAlishan))
ClearAllPersonalReputation(oAlishan, oSelf, TRUE);
AssignCommand(oSelf, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
DelayCommand(1.0, AssignCommand(oSelf, PlayVoiceChat(VOICE_CHAT_DEATH)));
DelayCommand(1.01, AssignCommand(oSelf, SpeakString("Пощади, "+GetName(oPC)+"!!!")));
DelayCommand(1.4, AssignCommand(oSelf, PlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 4.0)));
DelayCommand(1.5, RemoveingBadEffectForCut(oPC));
DelayCommand(2.0, RemoveingBadEffectForCut(oSelf));
DelayCommand(3.0, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_TALK_FORCEFUL, 1.0, 4.0)));
DelayCommand(3.5, AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_TALKTOME)));
DelayCommand(3.51, AssignCommand(oPC, SpeakString("Вставай! Будь мужчиной!")));
}
}
else
{
if (GetIsInCombat(oPC) || GetIsInCombat(oSelf) || IsInConversation(oPC))
{
if(GetIsAssociate(oPC, oAlishan) && GetIsInCombat(oAlishan))
{
AssignCommand(oAlishan, ClearAllActions(TRUE));
ClearAllPersonalReputation(oAlishan, oSelf, TRUE);
ChangeEnemyToNetral(oAlishan, oNeytral);
}
ChangeEnemyToNetral(oPC, oNeytral);
// РС или НПС занят, что то мешает им поговорить.
return;
}
else if (GetLocalInt(oSelf, "REPEAT")==TRUE)
{
object oItem1 = GetItemPossessedBy(oSelf, "AM_ITM_SHIELS012");
AssignCommand(oSelf, ClearAllActions());
AssignCommand(oSelf, ActionForceMoveToObject(oPC, FALSE, 1.0, 15.0));
AssignCommand(oSelf, ActionStartConversation(oPC));
AssignCommand(oSelf, ActionDoCommand(SetLocalInt(oSelf, "METHAN_BATTLE_PC", FALSE)));
AssignCommand(oSelf, ActionDoCommand(SetLocalInt(oSelf,"REPEAT", FALSE)));
AssignCommand(oSelf, ActionDoCommand(SetLocalInt(oSelf,"HIT_POINTS", FALSE)));
// Если Метхан не смог подойти и поговорить, напомним об этом
}
}
}
//------------------------------------------------------------------------------
}
//:: OnUserDefaine am_cud_methan
//:: Copyright © 2005 WRG!
//:://////////////////////////////////////////////
/*
Стандартный UserDefaine скрипт
*/
//:://////////////////////////////////////////////
//:: Created By: Aiwan
//:: Created On: 09.07.2005
//:://///////////////////////////////////////////
//#include "am_inc_battle"
//#include "am_inc_common"
//#include "am_inc_cutscene"
int GetIsAssociate(object oMaster, object oAssociate)
{
object oMaster = GetMaster(oAssociate);
if(oMaster != OBJECT_INVALID)
{
return TRUE;
}
return FALSE;
}
void ClearAllPersonalReputation(object oMaster, object oSource=OBJECT_SELF, int iClearAllActions = FALSE)
{
object oAnimal = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oMaster);
object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oMaster);
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oMaster);
object oSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oMaster);
if(iClearAllActions = TRUE)
AssignCommand(oMaster,ClearAllActions(TRUE));
ClearPersonalReputation(oMaster, oSource);
if(oAnimal != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oAnimal,ClearAllActions(TRUE));
ClearPersonalReputation(oAnimal, oSource);
}
if(oDominated != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oDominated,ClearAllActions(TRUE));
ClearPersonalReputation(oDominated, oSource);
}
if(oFamiliar != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oFamiliar,ClearAllActions(TRUE));
ClearPersonalReputation(oFamiliar, oSource);
}
if(oSummoned != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oSummoned,ClearAllActions(TRUE));
ClearPersonalReputation(oSummoned, oSource);
}
int i = 1;
object oHenchman = GetHenchman(oMaster, i);
while(oHenchman != OBJECT_INVALID)
{
if(iClearAllActions = TRUE)
AssignCommand(oHenchman,ClearAllActions(TRUE));
ClearPersonalReputation(oHenchman, oSource);
i++;
oHenchman = GetHenchman(oMaster, i);
}
}
void FreezeCompanion(object oPlayers, int bVanish=FALSE)
{
effect eAssociate = EffectCutsceneParalyze();
effect eInv = EffectVisualEffect(VFX_DUR_CUTSCENE_INVISIBILITY);
int i = 1;
object oHench = GetHenchman(oPlayers, i);
while(oHench != OBJECT_INVALID)
{
AssignCommand(oHench,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oHench));
if(bVanish==TRUE){
AssignCommand(oHench,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oHench));}
i++;
oHench = GetHenchman(oPlayers, i);
}
object oCompanion = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPlayers);
if (oCompanion != OBJECT_INVALID)
{
AssignCommand(oCompanion,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oCompanion));
if(bVanish==TRUE){
AssignCommand(oCompanion,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oCompanion));}
}
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPlayers);
if (oFamiliar != OBJECT_INVALID)
{
AssignCommand(oFamiliar,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oFamiliar));
if(bVanish==TRUE){
AssignCommand(oFamiliar,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oFamiliar));}
}
object oSummon = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPlayers);
if (oSummon != OBJECT_INVALID)
{
AssignCommand(oSummon,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oSummon));
if(bVanish==TRUE){
AssignCommand(oSummon,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oSummon));}
}
object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPlayers);
if (oDominated != OBJECT_INVALID)
{
AssignCommand(oDominated,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eAssociate, oDominated));
if(bVanish==TRUE){
AssignCommand(oDominated,
ApplyEffectToObject(DURATION_TYPE_PERMANENT, eInv, oDominated));}
}
}
void RemoveingBadEffectForCut(object oCreature)
{
effect eBad = GetFirstEffect(oCreature);
while(GetIsEffectValid(eBad))
{
if (GetEffectType(eBad) == EFFECT_TYPE_ABILITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_AC_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_ATTACK_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_DAMAGE_IMMUNITY_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SAVING_THROW_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SPELL_RESISTANCE_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_SKILL_DECREASE ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_DEAF ||
GetEffectType(eBad) == EFFECT_TYPE_PARALYZE ||
GetEffectType(eBad) == EFFECT_TYPE_POISON ||
GetEffectType(eBad) == EFFECT_TYPE_SLOW ||
GetEffectType(eBad) == EFFECT_TYPE_BLINDNESS ||
GetEffectType(eBad) == EFFECT_TYPE_NEGATIVELEVEL)
{
RemoveEffect(oCreature, eBad);
}
eBad = GetNextEffect(oCreature);
}
//Fire cast spell at event for the specified target
SignalEvent(oCreature, EventSpellCastAt(OBJECT_SELF, SPELL_RESTORATION, FALSE));
}
void CutsceneOn(object oPlayers)
{
if(GetCutsceneMode(oPlayers) == FALSE)
{
RemoveingBadEffectForCut(oPlayers);
SetLocalInt(oPlayers, "CUTSCENEMOD", TRUE);
SetCutsceneMode(oPlayers, TRUE);
}
}
void ChangeEnemyToNetral(object oPlayer, object oNetral)
{
object oArea = GetArea(oPlayer);
object oEnemy = GetFirstObjectInArea(oArea);
object oAnimal = GetAssociate(ASSOCIATE_TYPE_ANIMALCOMPANION, oPlayer);
object oDominated = GetAssociate(ASSOCIATE_TYPE_DOMINATED, oPlayer);
object oFamiliar = GetAssociate(ASSOCIATE_TYPE_FAMILIAR, oPlayer);
object oSummoned = GetAssociate(ASSOCIATE_TYPE_SUMMONED, oPlayer);
effect eEffect = EffectVisualEffect(VFX_IMP_UNSUMMON);
while (GetIsObjectValid(oEnemy))
{
if (GetIsEnemy(oPlayer,oEnemy))
{
/*
//------------------------------------------------------------------------------
// Если пойдет что-то не так. Будут жалобы игроков, то помощников НПС буду удалять...
//------------------------------------------------------------------------------
int iNum = 1;
while(iNum < 6)
{
object oAssociate = GetAssociate(iNum, oEnemy);
if(GetIsObjectValid(oAssociate))
{
ApplyEffectToObject(DURATION_TYPE_INSTANT, eEffect, oAssociate);
DestroyObject(oAssociate, 0.5);
}
iNum++;
}
*/
//----------------------- Обработка помощников игрока -------------------------//
if(oAnimal != OBJECT_INVALID) {
AssignCommand(oAnimal,ClearAllActions(TRUE));
ClearPersonalReputation(oAnimal,oEnemy);}
if(oDominated != OBJECT_INVALID){
AssignCommand(oDominated,ClearAllActions(TRUE));
ClearPersonalReputation(oDominated,oEnemy);}
if(oFamiliar != OBJECT_INVALID){
AssignCommand(oFamiliar,ClearAllActions(TRUE));
ClearPersonalReputation(oFamiliar,oEnemy);}
if(oSummoned != OBJECT_INVALID){
AssignCommand(oSummoned,ClearAllActions(TRUE));
ClearPersonalReputation(oSummoned,oEnemy);}
int i = 1;
object oHench = GetHenchman(oPlayer, i);
while(oHench != OBJECT_INVALID)
{
AssignCommand(oHench,ClearAllActions(TRUE));
ClearPersonalReputation(oHench,oEnemy);
i++;
oHench = GetHenchman(oPlayer, i);
}
AssignCommand(oEnemy,ClearAllActions(TRUE));
ClearPersonalReputation(oPlayer,oEnemy);
ChangeFaction(oEnemy,oNetral);
}
oEnemy = GetNextObjectInArea(oArea);
}
}
void main()
{
int nEvent = GetUserDefinedEventNumber();
object oPC = GetFirstPC();
object oSelf = OBJECT_SELF;
object oAlishan = GetObjectByTag("AM_HEN_ALISHAN");
object oNeytral = GetObjectByTag("GLOBAL_TRUE_NEUTRAL");
if (GetIsDead(OBJECT_SELF)==TRUE) return; // Если он помер, то пусть молчит
if (GetArea(OBJECT_SELF)!=GetArea(GetFirstPC())) return;
if (GetImmortal(OBJECT_SELF) == FALSE) return;
if(!GetLocalInt(oSelf, "METHAN_BATTLE_PC")) return;
//=========================== HEARTBEAT EVENT ==================================
if (nEvent == EVENT_HEARTBEAT) // Сигнал поступает User Defined Event 1001
{
int iCurHP = GetCurrentHitPoints(oSelf); // Количество поинтов максимум о Нпс
if(!GetLocalInt(oSelf, "HIT_POINTS"))
{
if (iCurHP <= 15)
{
CutsceneOn(oPC);
FreezeCompanion(oPC);
SetLocalInt(oSelf, "HIT_POINTS", TRUE);
SetLocalInt(oSelf, "REPEAT", TRUE);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oSelf, ClearAllActions(TRUE));
AssignCommand(oAlishan, ClearAllActions(TRUE));
ChangeEnemyToNetral(oPC, oNeytral);
ClearAllPersonalReputation(oPC, oSelf, TRUE);
if(GetIsAssociate(oPC, oAlishan))
ClearAllPersonalReputation(oAlishan, oSelf, TRUE);
AssignCommand(oSelf, ActionDoCommand(SetFacingPoint(GetPosition(oPC))));
DelayCommand(1.0, AssignCommand(oSelf, PlayVoiceChat(VOICE_CHAT_DEATH)));
DelayCommand(1.01, AssignCommand(oSelf, SpeakString("Пощади, "+GetName(oPC)+"!!!")));
DelayCommand(1.4, AssignCommand(oSelf, PlayAnimation(ANIMATION_LOOPING_MEDITATE, 1.0, 4.0)));
DelayCommand(1.5, RemoveingBadEffectForCut(oPC));
DelayCommand(2.0, RemoveingBadEffectForCut(oSelf));
DelayCommand(3.0, AssignCommand(oPC, PlayAnimation(ANIMATION_LOOPING_TALK_FORCEFUL, 1.0, 4.0)));
DelayCommand(3.5, AssignCommand(oPC, PlayVoiceChat(VOICE_CHAT_TALKTOME)));
DelayCommand(3.51, AssignCommand(oPC, SpeakString("Вставай! Будь мужчиной!")));
}
}
else
{
if (GetIsInCombat(oPC) || GetIsInCombat(oSelf) || IsInConversation(oPC))
{
if(GetIsAssociate(oPC, oAlishan) && GetIsInCombat(oAlishan))
{
AssignCommand(oAlishan, ClearAllActions(TRUE));
ClearAllPersonalReputation(oAlishan, oSelf, TRUE);
ChangeEnemyToNetral(oAlishan, oNeytral);
}
ChangeEnemyToNetral(oPC, oNeytral);
// РС или НПС занят, что то мешает им поговорить.
return;
}
else if (GetLocalInt(oSelf, "REPEAT")==TRUE)
{
object oItem1 = GetItemPossessedBy(oSelf, "AM_ITM_SHIELS012");
AssignCommand(oSelf, ClearAllActions());
AssignCommand(oSelf, ActionForceMoveToObject(oPC, FALSE, 1.0, 15.0));
AssignCommand(oSelf, ActionStartConversation(oPC));
AssignCommand(oSelf, ActionDoCommand(SetLocalInt(oSelf, "METHAN_BATTLE_PC", FALSE)));
AssignCommand(oSelf, ActionDoCommand(SetLocalInt(oSelf,"REPEAT", FALSE)));
AssignCommand(oSelf, ActionDoCommand(SetLocalInt(oSelf,"HIT_POINTS", FALSE)));
// Если Метхан не смог подойти и поговорить, напомним об этом
}
}
}
//------------------------------------------------------------------------------
}
А вот этот скрипт простой и он был описан в скриптах для новичков. Нахер я им все писал не пойму там никто не ходит...
НПС после нападения становится нейтральным и начинает диалог с РС. В свойствах НПС поставь Immortal галочку. Что бы не убить его с одного удара.
Neverwinter Script Source
//------------------------------------------------------------------------------
// Добавляем на хертбит Нпс.
//------------------------------------------------------------------------------
object oSelf = OBJECT_SELF;
object oPC = GetFirstPC(); // Это самое простое. Можно узнать по демагу или ближайший крич
int iCurHP = GetCurrentHitPoints(oSelf); // Количество поинтов максимум о Нпс
int iMaxHP = GetMaxHitPoints(oSelf); // Сколько в данный момент
if(!GetLocalInt(oSelf, "STOP"))
{
if (iCurHP < iMaxHP/4) // Четверть нр от общего или меньше
{
// Если это враг то меняем ему фракцию на комманера. Если нет, то убери эту строку
ChangeToStandardFaction(oSelf, STANDARD_FACTION_COMMONER);
SetLocalInt(oSelf, "STOP", TRUE);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oSelf, ClearAllActions(TRUE));
ClearPersonalReputation(oPC, oSelf);
AssignCommand(oSelf, PlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0, 5.0));
DelayCommand(0.3, SetCommandable(FALSE, oPC));
DelayCommand(1.5, AssignCommand(oSelf, SpeakString("Дядя, простите, я больше так не буду!")));
/*
Тут описываешь важнецкие клятвы в верности, слезные истории про трудное дество...
*/
DelayCommand(5.0, AssignCommand(oSelf, ActionMoveToObject(oPC)));
DelayCommand(5.4, AssignCommand(oSelf, ActionDoCommand(SetCommandable(TRUE, oPC))));
DelayCommand(5.6, AssignCommand(oSelf, ActionStartConversation(oPC)));
}
}
//------------------------------------------------------------------------------
// Добавляем на хертбит Нпс.
//------------------------------------------------------------------------------
object oSelf = OBJECT_SELF;
object oPC = GetFirstPC(); // Это самое простое. Можно узнать по демагу или ближайший крич
int iCurHP = GetCurrentHitPoints(oSelf); // Количество поинтов максимум о Нпс
int iMaxHP = GetMaxHitPoints(oSelf); // Сколько в данный момент
if(!GetLocalInt(oSelf, "STOP"))
{
if (iCurHP < iMaxHP/4) // Четверть нр от общего или меньше
{
// Если это враг то меняем ему фракцию на комманера. Если нет, то убери эту строку
ChangeToStandardFaction(oSelf, STANDARD_FACTION_COMMONER);
SetLocalInt(oSelf, "STOP", TRUE);
AssignCommand(oPC, ClearAllActions(TRUE));
AssignCommand(oSelf, ClearAllActions(TRUE));
ClearPersonalReputation(oPC, oSelf);
AssignCommand(oSelf, PlayAnimation(ANIMATION_LOOPING_TALK_PLEADING, 1.0, 5.0));
DelayCommand(0.3, SetCommandable(FALSE, oPC));
DelayCommand(1.5, AssignCommand(oSelf, SpeakString("Дядя, простите, я больше так не буду!")));
/*
Тут описываешь важнецкие клятвы в верности, слезные истории про трудное дество...
*/
DelayCommand(5.0, AssignCommand(oSelf, ActionMoveToObject(oPC)));
DelayCommand(5.4, AssignCommand(oSelf, ActionDoCommand(SetCommandable(TRUE, oPC))));
DelayCommand(5.6, AssignCommand(oSelf, ActionStartConversation(oPC)));
}
}
//------------------------------------------------------------------------------