The problem with OpenWall() is that you're using wrong function to get the PC. You used GetLastUsedBy() when it should be GetItemActivator().
The problem with BlowHorn() is trickier. I suspect that the script is working correctly, but the second message gets spoken so soon after the first message that you don't get to see it on screen. Look in the chat window to see if it shows up there. If that's correct, try DelayCommand-ing the second SpeakString() or changing it to a FloatingTextStringOnCreature().
I cleaned this up a bit if you wanna try to use my edits. Not at a computer with the toolset right now, so I can't confirm whether it works, but it's a step in the right direction.
#include "debug"
#include "nw_i0_tool"
void BlowHorn(string sHorn, string sMessage, object oPC);
void OpenWall(object oPC);
void main()
{
object oPC = GetItemActivator();
object oItem = GetItemActivated();
object oTarget = GetItemActivatedTarget();
string sTag = GetTag(oItem);
ExecuteScript("eb_recall_oa", OBJECT_SELF);
if (sTag == "CreateFoodItem")
{
CreateItemOnObject("food001", oTarget);
CreateItemOnObject("food001", oTarget);
CreateItemOnObject("food001", oTarget);
CreateItemOnObject("food001", oTarget);
SendMessageToPC(oPC, "Food Created");
AssignCommand(oTarget, PlaySound("sca_outholy01"));
effect eVis = EffectVisualEffect(VFX_IMP_HEAD_HEAL);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, oTarget);
}
else if (sTag == "NorthWind")
{
//debug("NorthWind");
AssignCommand(oTarget, PlaySound("as_wt_gustsoft1"));
BlowHorn(sTag, "You feel a cold draft from the north.", oPC);
OpenWall(oPC);
}
else if (sTag == "SouthWind")
{
//debug("SouthWind");
AssignCommand(oTarget, PlaySound("as_wt_gusforst1"));
BlowHorn(sTag, "You feel a warm breeze from the south.", oPC);
OpenWall(oPC);
}
else if (sTag == "EastWind")
{
//debug("EastWind");
AssignCommand(oTarget, PlaySound("as_wt_gustgrass1"));
BlowHorn(sTag, "You feel a slight breeze from the east.", oPC);
OpenWall(oPC);
}
else if (sTag == "WestWind")
{
//debug("WestWind");
AssignCommand(oTarget, PlaySound("as_wt_gustchasm1"));
BlowHorn(sTag, "You feel a gust of wind from the west.", oPC);
OpenWall(oPC);
}
}
void OpenWall(object oPC)
{
//object oWindWallWP = GetWaypointByTag("WP_FourWindWall");
debug("OpenWall");
if (GetLocalInt(oPC, "NorthWind") && GetLocalInt(oPC, "SouthWind") &&
GetLocalInt(oPC, "EastWind") && GetLocalInt(oPC, "WestWind"))
{
SetLocalInt(oPC, "WallIsOpen", 1);
//SetLocalInt(oPC(), sHorn, 1);
object UnlockedSound = GetNearestObjectByTag("WindRmvSnd");
object oObject1 = GetNearestObjectByTag("WindSeal1");
object oObject2 = GetNearestObjectByTag("WindSeal2");
object oObject3 = GetNearestObjectByTag("WindSeal3");
object oObject4 = GetNearestObjectByTag("WindSeal4");
object oObject5 = GetNearestObjectByTag("SealoftheFourWinds");
DestroyObject(oObject1, 0.0);
DestroyObject(oObject2, 0.1);
DestroyObject(oObject3, 0.2);
DestroyObject(oObject4, 0.3);
DestroyObject(oObject5, 0.5);
SoundObjectPlay(UnlockedSound);
PlaySound("as_dr_stonvlgcl1");
FloatingTextStringOnCreature("The wall of the four winds has been removed.", oPC, FALSE);
AddJournalQuestEntry("TheFourHorns", 5, oPC);
RewardPartyXP(750, oPC, TRUE);
//DelayCommand(0.5, DestroyObject(OBJECT_SELF));
effect eVis = EffectVisualEffect(VFX_FNF_SCREEN_SHAKE);
ApplyEffectToObject(DURATION_TYPE_INSTANT, eVis, OBJECT_SELF);
DestroyObject(UnlockedSound, 4.0);
}
}
void BlowHorn(string sHorn, string sMessage, object oPC)
{
//debug("BlowHorn");
object oWindWallWP = GetWaypointByTag("WP_FourWindWall");
float fDistance = GetDistanceBetweenLocations(GetLocation(oPC), GetLocation(oWindWallWP));
if (fDistance < 5.0)
{
//debug("Distance = " + FloatToString(fDistance));
SetLocalInt(oPC, sHorn, 1);
// Insert Sound Effect here
// sff_howlmind
AssignCommand(oPC, PlaySound("sff_howlmind"));
FloatingTextStringOnCreature("A hollow sound comes from the horn.", oPC, FALSE);
FloatingTextStringOnCreature(sMessage, oPC, FALSE);
//DelayCommand(60.0, SetLocalInt(oWindWallWP, sHorn, 0));
}
}
Modifié par Squatting Monk, 20 juin 2013 - 07:44 .