Hey thanks for your help. So my issue here is there is no pc conversation in the actual conversation editor thing. I have the pc reply in the script.
Npc:"That my package?" txt only if check is TRUE; do Action"receive package"
Npc:"Get out of my shop!" txt only if bad faction
Npc:"Hello would you like to see my wares?" txt only if decent faction
pc:yes
pc:no
NPC:"So nice to see you again!" txt only if good faction.
pc:yes
pc:no
I just don't understand why it does most of the script but jumps over destroying the tool.
Here is my actual code. Just a heads up, the Ambrosia mod written by UOAbigail is heavily scripted. Each PC has an "OOC Tool" that, among other things, allows you to store variables. I use this to store PC quest status. You will see my testing messages as well.
Remember this works correctly when it's nested in the conversation, but when it's just the NPC saying something with no PC convo to click on, it skips right over the part that destroys the object. It does do the rest of the script though. Any ideas why?
void main()
{
//NPC receives the item from PC.
//Sends them back to Sender ID.
object oSelf = OBJECT_SELF;
object oPC = GetPCSpeaker();
string sMt = "You are "+GetName(oSelf)+"?";
FloatingTextStringOnCreature(sMt,oPC,FALSE);
ActionSpeakString("For me? Right, put it over here.",TALKVOLUME_TALK);
int iQid = GetLocalInt(oSelf,"iSageQuest_id"); //NPC QuestID
string sTag = "Parcel"+IntToString(iQid);
//Parcel tag
string sQuest = "sg_quest_"+IntToString(iQid);
object oItem = GetItemPossessedBy(oPC,sTag);
int iQuest = GetLocalInt(oItem,sQuest); //Get Quest #
int iSender = GetLocalInt(oItem,sTag); //Get sender ID
string sMz = sQuest+" = "+IntToString(iQuest);
SendMessageToPC(oPC,sMz);
string sMj = sTag+" = "+IntToString(iSender);
SendMessageToPC(oPC,sMj);
//FloatingTextStringOnCreature("Yes, here is your parcel.",oPC); //Reply to NPC
//PC Voice something
//PC Body Action Bow / Possibly NPC action/voice in response.
string sMe = "I'm about to destroy "+GetName(oItem);
SendMessageToPC(oPC,sMe);
DestroyObject(oItem); //Destroy Parcel
//Reward
string sSend = Get2DAString("sg_quest","Name",iSender); //Find Sender Name
int iReward = GetLocalInt(oSelf,"iSage_rcvd_reward") * iQuest; //Create reward amount
string sMsg;
if (iQuest != 0) {sMsg = "Here, take this for your trouble.";} //If gold reward
else {sMsg = "Please give "+sSend+" my thanks.";} //If no gold reward
DelayCommand(2.0,ActionSpeakString(sMsg,TALKVOLUME_TALK));
if (iReward != 0) {DelayCommand(2.5,GiveGoldToCreature(oPC,iReward));}
object oTool = GetItemPossessedBy(oPC,"WW_OOCTool"); //Set Rcvd status
string sQst = "sg_quest_"+IntToString(iSender);
SetLocalInt(oTool,sQst,1);
ExportSingleCharacter(oPC);
}
Modifié par AmbrosiaPW, 25 avril 2011 - 09:12 .