1
Skrypty / Problem z areną
« dnia: 2013-01-30, 22:52 »
Witam,
mam takiż oto problem, chciałem zrobić coś takiego, że NPC, u którego ustawiało się walki sam stawał na środku areny i walczył z bohaterem. Edytowałem skrypt Scatty'ego, wszystko idzie dobrze ale po walce nie mogę uruchomić kolejnego dialogu, w którym bym się np chwalił zwycięstwem. Myślałem, że on może gniewać się za pobicie i nie chce gadać, ale wtedy raczej całkowicie nie dało się z nim pogadać a teraz mam okno dialogowe z samym napisem koniec. Dla pewności dodałem, żeby stał się friendly po walce ale to nic nie dało.
Zamieszczam także fragment kodu, mam nadzieje, że ułatwi zlokalizowanie usterki.
mam takiż oto problem, chciałem zrobić coś takiego, że NPC, u którego ustawiało się walki sam stawał na środku areny i walczył z bohaterem. Edytowałem skrypt Scatty'ego, wszystko idzie dobrze ale po walce nie mogę uruchomić kolejnego dialogu, w którym bym się np chwalił zwycięstwem. Myślałem, że on może gniewać się za pobicie i nie chce gadać, ale wtedy raczej całkowicie nie dało się z nim pogadać a teraz mam okno dialogowe z samym napisem koniec. Dla pewności dodałem, żeby stał się friendly po walce ale to nic nie dało.
Zamieszczam także fragment kodu, mam nadzieje, że ułatwi zlokalizowanie usterki.
Spoiler
instance Info_Zyla_Charge(C_INFO)
{
npc = Zyla;
nr = 1;
condition = Info_Zyla_Charge_Condition;
information = Info_Zyla_Charge_Info;
permanent = 0;
description = "Twoja kolej!";
};
FUNC INT Info_Zyla_Charge_Condition()
{
if (Npc_KnowsInfo (hero,DIA_Zyla_KHARIMSUCCESS) && (Kapitel <= 1)) // Kapitelfix ***Björn***
{
return 1;
};
};
func VOID Info_Zyla_Charge_Info()
{
AI_Output (other, self,"Info_Zyla_Charge_15_00"); //Twoja kolej!
AI_Output (self, other,"Info_Kirgo_Charge_05_01"); //No dobra, ale pierw walnijmy sobie po browarku!
AI_Output (other, self,"Info_Kirgo_Charge_Beer_15_00"); //Dobra, ty stawiasz!
AI_Output (self, other,"Info_Kirgo_Charge_Beer_05_01"); //Proszę bardzo!
CreateInvItem (self, ItFoBeer);
B_GiveInvItems (self, other, ItFoBeer, 1);
AI_UseItem (self, ItFoBeer);
AI_UseItem (other, ItFoBeer);
self.npctype = npctype_FRIEND;
};
// **************************************
// Fordern REAL
// **************************************
var int Zyla_Charged;
// **************************************
instance Info_Zyla_ChargeREAL(C_INFO)
{
npc = Zyla;
nr = 1;
condition = Info_Zyla_ChargeREAL_Condition;
information = Info_Zyla_ChargeREAL_Info;
permanent = 0;
description = "Chcę z tobą walczyć - jesteś gotów?";
};
FUNC INT Info_Zyla_ChargeREAL_Condition()
{
if (Npc_KnowsInfo (hero,Info_Zyla_Charge)) //Kapitelfix ****Björn****
{
return 1;
};
};
func VOID Info_Zyla_ChargeREAL_Info()
{
AI_Output (other, self,"Info_Zyla_ChargeREAL_15_00"); //Chcę z tobą walczyć - jesteś gotów?
AI_Output (self, other,"Info_Zyla_ChargeREAL_05_01"); //Chodź za mną!
AI_StopProcessInfos ( self );
Zyla_Charged = TRUE;
Npc_ExchangeRoutine(self,"GUIDE");
};
// **************************************
// IN DER ARENA
// **************************************
instance Info_Zyla_InArena (C_INFO)
{
npc = Zyla;
nr = 1;
condition = Info_Zyla_InArena_Condition;
information = Info_Zyla_InArena_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Zyla_InArena_Condition()
{
if ( (Zyla_Charged == TRUE) && (Npc_GetDistToWp (hero,"OCR_ARENABATTLE_TRAIN") < 500) )
{
return 1;
};
};
func VOID Info_Zyla_InArena_Info()
{
if (Kapitel <= 1) //Fix für spätere Kapitel ****Björn****
{
AI_Output (self, other,"Info_Zyla_InArena_05_00"); //Dobra, zaczynajmy! Niech wygra najlepszy!
AI_StopProcessInfos ( self );
Npc_ExchangeRoutine(self,"START");
Npc_SetTarget(self,other);
AI_StartState(self,ZS_ATTACK,1,"");
self.npctype = npctype_FRIEND;
Zyla_ChargeZyla = LOG_RUNNING;
var C_NPC Zyla; Zyla = Hlp_GetNpc(Zyla); Zyla.aivar[AIV_WASDEFEATEDBYSC] = FALSE; Zyla.aivar[AIV_HASDEFEATEDSC] = FALSE;
}
else
{
AI_Output (self, other,"SVM_5_LetsForgetOurLittleFight"); //Może zapomnijmy o naszej małej sprzeczce, dobra?
AI_StopProcessInfos ( self );
Npc_ExchangeRoutine(self,"START");
self.npctype = npctype_FRIEND;
};
};
// **************************************************
// Zyla SUCCESS
// **************************************************
INSTANCE DIA_Zyla_ZylaSuccess (C_INFO)
{
npc = Zyla;
nr = 1;
condition = DIA_Zyla_ZylaSuccess_Condition;
information = DIA_Zyla_ZylaSuccess_Info;
permanent = 0;
description = "To była dobra walka!";
};
FUNC INT DIA_Zyla_ZylaSuccess_Condition()
{
var C_NPC Zyla; Zyla = Hlp_GetNpc(Zyla);
if ( (NPC_KnowsInfo(hero, Info_Zyla_InArena)) && (Zyla_ChargeZyla == LOG_RUNNING) && (Zyla_Charged == TRUE) && ( (Zyla.aivar[AIV_WASDEFEATEDBYSC] == TRUE) || (Zyla.aivar[AIV_HASDEFEATEDSC] == TRUE) ) )
{
return 1;
};
};
FUNC VOID DIA_Zyla_ZylaSuccess_Info()
{
var C_NPC Zyla; Zyla = Hlp_GetNpc(Zyla);
AI_Output (other,self,"DIA_Zyla_ZylaSuccess_15_00"); //To była dobra walka!
if (Zyla.aivar[AIV_HASDEFEATEDSC] == TRUE)
{
AI_Output (self,other,"DIA_Zyla_ZylaSuccess_01_01"); //Tak, ale przegrałeś!
AI_Output (self,other,"DIA_Zyla_ZylaSuccess_01_02"); //Ale nie martw się! Udziele Ci mojego poparcia, gdy rada o ciebie zapyta! A wiesz czemu? Bo piliśmy razem browara! Jesteśmy kumplami a kumpli się nie zostawia!
Zyla_ChargeZyla = LOG_FAILED;
B_LogEntry (CH1_ZylaQuest,"Może i przegrałem ale Żyła i tak udzeli mi swojego poparcia.");
Log_SetTopicStatus (CH1_ZylaQuest, LOG_SUCCESS);
MIS_ZylaQuest = LOG_SUCCESS;
B_GiveXP (80);
B_LogEntry (CH1_OCHero,"Może i przegrałem ale Żyła i tak udzieli mi swojego poparcia.");
self.npctype = npctype_FRIEND;
}
else if (Zyla.aivar[AIV_WASDEFEATEDBYSC] == TRUE)
{
AI_Output (self,other,"DIA_Zyla_ZylaSuccess_01_03"); //I pokonałeś mnie! Całkiem nieźle jak na takiego żółtodzioba! Jestem pod wrażeniem!
Zyla_ChargeZyla = LOG_SUCCESS;
B_LogEntry( CH1_ZylaQuest, "Żyła przegrał, teraz czas zdetronizować Maximusa!");
B_GiveXP (120);
Zyla_ChargeKirgo = LOG_RUNNING;
var C_NPC Kirgo; Kirgo = Hlp_GetNpc(Grd_251_Kirgo); Kirgo.aivar[AIV_WASDEFEATEDBYSC] = FALSE; Kirgo.aivar[AIV_HASDEFEATEDSC] = FALSE;
self.npctype = npctype_FRIEND;
};
};
{
npc = Zyla;
nr = 1;
condition = Info_Zyla_Charge_Condition;
information = Info_Zyla_Charge_Info;
permanent = 0;
description = "Twoja kolej!";
};
FUNC INT Info_Zyla_Charge_Condition()
{
if (Npc_KnowsInfo (hero,DIA_Zyla_KHARIMSUCCESS) && (Kapitel <= 1)) // Kapitelfix ***Björn***
{
return 1;
};
};
func VOID Info_Zyla_Charge_Info()
{
AI_Output (other, self,"Info_Zyla_Charge_15_00"); //Twoja kolej!
AI_Output (self, other,"Info_Kirgo_Charge_05_01"); //No dobra, ale pierw walnijmy sobie po browarku!
AI_Output (other, self,"Info_Kirgo_Charge_Beer_15_00"); //Dobra, ty stawiasz!
AI_Output (self, other,"Info_Kirgo_Charge_Beer_05_01"); //Proszę bardzo!
CreateInvItem (self, ItFoBeer);
B_GiveInvItems (self, other, ItFoBeer, 1);
AI_UseItem (self, ItFoBeer);
AI_UseItem (other, ItFoBeer);
self.npctype = npctype_FRIEND;
};
// **************************************
// Fordern REAL
// **************************************
var int Zyla_Charged;
// **************************************
instance Info_Zyla_ChargeREAL(C_INFO)
{
npc = Zyla;
nr = 1;
condition = Info_Zyla_ChargeREAL_Condition;
information = Info_Zyla_ChargeREAL_Info;
permanent = 0;
description = "Chcę z tobą walczyć - jesteś gotów?";
};
FUNC INT Info_Zyla_ChargeREAL_Condition()
{
if (Npc_KnowsInfo (hero,Info_Zyla_Charge)) //Kapitelfix ****Björn****
{
return 1;
};
};
func VOID Info_Zyla_ChargeREAL_Info()
{
AI_Output (other, self,"Info_Zyla_ChargeREAL_15_00"); //Chcę z tobą walczyć - jesteś gotów?
AI_Output (self, other,"Info_Zyla_ChargeREAL_05_01"); //Chodź za mną!
AI_StopProcessInfos ( self );
Zyla_Charged = TRUE;
Npc_ExchangeRoutine(self,"GUIDE");
};
// **************************************
// IN DER ARENA
// **************************************
instance Info_Zyla_InArena (C_INFO)
{
npc = Zyla;
nr = 1;
condition = Info_Zyla_InArena_Condition;
information = Info_Zyla_InArena_Info;
permanent = 0;
important = 1;
};
FUNC INT Info_Zyla_InArena_Condition()
{
if ( (Zyla_Charged == TRUE) && (Npc_GetDistToWp (hero,"OCR_ARENABATTLE_TRAIN") < 500) )
{
return 1;
};
};
func VOID Info_Zyla_InArena_Info()
{
if (Kapitel <= 1) //Fix für spätere Kapitel ****Björn****
{
AI_Output (self, other,"Info_Zyla_InArena_05_00"); //Dobra, zaczynajmy! Niech wygra najlepszy!
AI_StopProcessInfos ( self );
Npc_ExchangeRoutine(self,"START");
Npc_SetTarget(self,other);
AI_StartState(self,ZS_ATTACK,1,"");
self.npctype = npctype_FRIEND;
Zyla_ChargeZyla = LOG_RUNNING;
var C_NPC Zyla; Zyla = Hlp_GetNpc(Zyla); Zyla.aivar[AIV_WASDEFEATEDBYSC] = FALSE; Zyla.aivar[AIV_HASDEFEATEDSC] = FALSE;
}
else
{
AI_Output (self, other,"SVM_5_LetsForgetOurLittleFight"); //Może zapomnijmy o naszej małej sprzeczce, dobra?
AI_StopProcessInfos ( self );
Npc_ExchangeRoutine(self,"START");
self.npctype = npctype_FRIEND;
};
};
// **************************************************
// Zyla SUCCESS
// **************************************************
INSTANCE DIA_Zyla_ZylaSuccess (C_INFO)
{
npc = Zyla;
nr = 1;
condition = DIA_Zyla_ZylaSuccess_Condition;
information = DIA_Zyla_ZylaSuccess_Info;
permanent = 0;
description = "To była dobra walka!";
};
FUNC INT DIA_Zyla_ZylaSuccess_Condition()
{
var C_NPC Zyla; Zyla = Hlp_GetNpc(Zyla);
if ( (NPC_KnowsInfo(hero, Info_Zyla_InArena)) && (Zyla_ChargeZyla == LOG_RUNNING) && (Zyla_Charged == TRUE) && ( (Zyla.aivar[AIV_WASDEFEATEDBYSC] == TRUE) || (Zyla.aivar[AIV_HASDEFEATEDSC] == TRUE) ) )
{
return 1;
};
};
FUNC VOID DIA_Zyla_ZylaSuccess_Info()
{
var C_NPC Zyla; Zyla = Hlp_GetNpc(Zyla);
AI_Output (other,self,"DIA_Zyla_ZylaSuccess_15_00"); //To była dobra walka!
if (Zyla.aivar[AIV_HASDEFEATEDSC] == TRUE)
{
AI_Output (self,other,"DIA_Zyla_ZylaSuccess_01_01"); //Tak, ale przegrałeś!
AI_Output (self,other,"DIA_Zyla_ZylaSuccess_01_02"); //Ale nie martw się! Udziele Ci mojego poparcia, gdy rada o ciebie zapyta! A wiesz czemu? Bo piliśmy razem browara! Jesteśmy kumplami a kumpli się nie zostawia!
Zyla_ChargeZyla = LOG_FAILED;
B_LogEntry (CH1_ZylaQuest,"Może i przegrałem ale Żyła i tak udzeli mi swojego poparcia.");
Log_SetTopicStatus (CH1_ZylaQuest, LOG_SUCCESS);
MIS_ZylaQuest = LOG_SUCCESS;
B_GiveXP (80);
B_LogEntry (CH1_OCHero,"Może i przegrałem ale Żyła i tak udzieli mi swojego poparcia.");
self.npctype = npctype_FRIEND;
}
else if (Zyla.aivar[AIV_WASDEFEATEDBYSC] == TRUE)
{
AI_Output (self,other,"DIA_Zyla_ZylaSuccess_01_03"); //I pokonałeś mnie! Całkiem nieźle jak na takiego żółtodzioba! Jestem pod wrażeniem!
Zyla_ChargeZyla = LOG_SUCCESS;
B_LogEntry( CH1_ZylaQuest, "Żyła przegrał, teraz czas zdetronizować Maximusa!");
B_GiveXP (120);
Zyla_ChargeKirgo = LOG_RUNNING;
var C_NPC Kirgo; Kirgo = Hlp_GetNpc(Grd_251_Kirgo); Kirgo.aivar[AIV_WASDEFEATEDBYSC] = FALSE; Kirgo.aivar[AIV_HASDEFEATEDSC] = FALSE;
self.npctype = npctype_FRIEND;
};
};