To transfer severel quest from single NPC reward to party reward i need a script that does following...
A: only Works if partymember dont have item X
and is in same area as PC talking to npc.
B: takes itemY from intire party
Gives XP xxx to intire party
Gives GOLD xxx to intire party.
Gives itemX to intire party
In short the script i need to fix various quests to party settings.
/tara
(IN PROGRESS) Party reward script
Re: Need this script ASAP
I suggest a variant, where we give out the quest item to the entire party - then I won't have to rework the entire quest script framework I'll catch you on Skype.
Somnium (a.k.a. Seeker)
Re: Need this script ASAP
I just PMed this code to tarashon if you want to look it over, Somnium.
Code: Select all
void main()
{
// Set up objects for the person turning in their quest and for the loop
object oPC = GetPCSpeaker(), oPlayer;
// Get the first faction member in the PC's party (PC-only)
oPlayer = GetFirstFactionMember(oPC, TRUE);
while (GetIsObjectValid(oPlayer))
{
// If they don't have the quest token AND they're in the same area as the person turning in the quest
if (GetItemPossessedBy(oPlayer, "questtoken") == OBJECT_INVALID && GetArea(oPC) == GetArea(oPlayer))
{
// Destroy the quest item and then give them gold, XP, and the quest token
DestroyObject(GetItemPossessedBy(oPlayer, "questitem"));
GiveGoldToCreature(oPlayer, 10000);
GiveXPToCreature(oPlayer, 2000);
SetItemCursedFlag(CreateItemOnObject("questtoken", oPlayer), TRUE);
}
// Get the next faction member in the PC's party (PC-only)
oPlayer = GetNextFactionMember(oPC, TRUE);
}
}
Re: Need this script ASAP
Thanks alot MagicalMaster
Just talked to Seeker though and he explained me that basically "looping" over player items like that creates some massive lagspikes. Instead we will go for a version that checks for questgem/quest database completed ( whatever ) and gives those who are in party and same area the needed bossdrop directly.
So basically allmost all, if not all, quests requirering 1 item from one "named" will be Group completeable withinn this weekend depending on when Seeker can make the script - he is making it so it works together with the overall quest system that shall - over time - remove questgems intirely.
So really sorry if your time was wasted. In my defense I had hoped to have this done before tonite but that will not be possible i'm afraid...
/tara
Just talked to Seeker though and he explained me that basically "looping" over player items like that creates some massive lagspikes. Instead we will go for a version that checks for questgem/quest database completed ( whatever ) and gives those who are in party and same area the needed bossdrop directly.
So basically allmost all, if not all, quests requirering 1 item from one "named" will be Group completeable withinn this weekend depending on when Seeker can make the script - he is making it so it works together with the overall quest system that shall - over time - remove questgems intirely.
So really sorry if your time was wasted. In my defense I had hoped to have this done before tonite but that will not be possible i'm afraid...
/tara
Re: Need this script ASAP
It took like 10 minutes of time once I saw it, not a huge deal.tarashon wrote:So really sorry if your time was wasted.
This part confuses me, though -- yeah, something like GetItemPossessedBy is basically looping through player items and if players are carrying a ton of items it could potentially cause issues (you'd need a LOT of items, though), but how are you planning on removing the quest item from players WITHOUT effectively looping through the player's items?tarashon wrote:Just talked to Seeker though and he explained me that basically "looping" over player items like that creates some massive lagspikes. Instead we will go for a version that checks for questgem/quest database completed ( whatever ) and gives those who are in party and same area the needed bossdrop directly.
I was wondering why you weren't tracking information on a single token or using a database, but figured it really wasn't a big enough deal to worry abouttarashon wrote:he is making it so it works together with the overall quest system that shall - over time - remove questgems intirely.
Re: Need this script ASAP
It's a matter of scale. While it is indeed impossible to avoid looping through player items when removing a quest item, I prefer looping through a single player's inventory in a single script, over looping through all party member inventories in a single script. Especially since we might later wish to support taking a specific number of quest items instead of only one.Balkoth wrote: This part confuses me, though -- yeah, something like GetItemPossessedBy is basically looping through player items and if players are carrying a ton of items it could potentially cause issues (you'd need a LOT of items, though), but how are you planning on removing the quest item from players WITHOUT effectively looping through the player's items?
Also, the script requested above wouldn't really solve the problem, since currently the party will typically only be rewarded a single quest item. Hence the script above would typically still only reward a single player, but would now iterate over every party member's inventory in order to do so.
We will probably go for more of an "instancing" approach: Every party member in the same area as the "boss" being killed, will receive their own copy of the quest item, which they can then hand over to the quest giver at their leasure.
The quest system replacing the quest gem system, was introduced a few weeks before Alangara closed down back in the day, so we were still in the process of migrating the existing quests. As Tarashon mentioned, the end goal is to migrate all quests to use the new quest system instead of the quest gem systemBalkoth wrote: I was wondering why you weren't tracking information on a single token or using a database, but figured it really wasn't a big enough deal to worry about
Somnium (a.k.a. Seeker)