One of my side quests involves looking for, and hopefully finding two ancient artifacts - a sword & a bow used by a legendary hero called Escatha. I'm trying to set up scripts that fire on acquiring each of the items.
Tag of the bow is escathabow
Tag of hte sword is escathaswd
I want the scripts to:
Check if the party already has possession of the other object and
if so:
1. Give 250xp
2. Produce floaty text above the PC saying "Well done - you have both items now" - or similar
3. Update the journal "Ancient Artifacts" to node 40
if not:
1. Give 250xp
2. Produce floaty text above the PC saying "Well done - you've found one of the weapons" - or similar
3. Update the journal "Ancient Artifacts" to node 20 or 30 - depending on which weapon's been found, and which still remains to be found
For some reason I really don't understand, the script for the bow updates the journal to node 20 regardless of whether the sword's in the party's possession or not, but doesn't produce floaty text, or give XP.
The script for the sword doesn't do anything at all.
I've checked the tags of the two weapons, even made a completely seperate area & added them as objects on the ground that a test character can just wander over & pick up - still no change.
Here are the scripts below - created using the updated Lilac Soul script creator - please feel free to point & laugh - as long as you can help me sort them out
And please remember - in case its not obvious - I'm no scripter - please use short words:
The Bow script:
#include "x0_i0_partywide"
void OnAcquire(object oEventItem, object oAcquiredBy, object oTakenFrom, int nStackSize)
{
object oPC = oAcquiredBy;
// Only fire for PCs.
if ( !GetIsPC(oPC) )
return;
// Only fire once per game.
if ( GetLocalInt(GetModule(), "DOONCE_OnAcquire_" + GetTag(oEventItem)) )
return;
SetLocalInt(GetModule(), "DOONCE_OnAcquire_" + GetTag(oEventItem), TRUE);
// If the PC's party has the item "escathaswd".
if ( GetIsItemPossessedByParty(oPC, "escathaswd") )
{
// Update all players' journals.
AddJournalQuestEntry("Ancient Artifacts", 40, oPC, FALSE, TRUE);
// Give 250 experience (to party) to the PC.
GiveXPToAll(oPC, 250);
// Have text appear over the PC's head.
FloatingTextStringOnCreature("you found both artifacts - well done!", oPC);
}
else
{
// Update all players' journals.
AddJournalQuestEntry("Ancient Artifacts", 20, oPC, FALSE, TRUE);
// Give 250 experience to the PC.
GiveXPToCreature(oPC, 250);
// Have text appear over the PC's head.
FloatingTextStringOnCreature("you got the bow - now find the sword!", oPC);
}
}
The Sword script:
#include "x0_i0_partywide"
void OnAcquire(object oEventItem, object oAcquiredBy, object oTakenFrom, int nStackSize)
{
object oPC = oAcquiredBy;
// Only fire for PCs.
if ( !GetIsPC(oPC) )
return;
// Only fire once per game.
if ( GetLocalInt(GetModule(), "DOONCE_OnAcquire_" + GetTag(oEventItem)) )
return;
SetLocalInt(GetModule(), "DOONCE_OnAcquire_" + GetTag(oEventItem), TRUE);
// If the PC's party has the item "escathaswd".
if ( GetIsItemPossessedByParty(oPC, "escathabow") )
{
// Update all players' journals.
AddJournalQuestEntry("Ancient Artifacts", 40, oPC, FALSE, TRUE);
// Give 250 experience (to party) to the PC.
GiveXPToAll(oPC, 250);
// Have text appear over the PC's head.
FloatingTextStringOnCreature("you found both artifacts - well done!", oPC);
}
else
{
// Update all players' journals.
AddJournalQuestEntry("Ancient Artifacts", 20, oPC, FALSE, TRUE);
// Give 250 experience to the PC.
GiveXPToCreature(oPC, 250);
// Have text appear over the PC's head.
FloatingTextStringOnCreature("you got the sword - now find the bow!", oPC);
}
}
Many thanks in advance folks - you're always awesome & I'm sure you will be here too...
Cly.





Retour en haut







