PDA

View Full Version : wesQuest *Give_Item*


mByte
01-20-2003, 04:31 PM
Another small update to the wesQuest.cpp

Syntax GIVE_ITEM [itemid] [charges]

TRIGGER_TEXT:yes:{
EMOTE:Gives %CHARNAME% a list to give to Mendela Charcoal.
SAY:Here you go, hurry back ok?
GIVE_ITEM 1001 0
}

Add this around line 411 atleast in my wesQuest.cpp thats the line

else if (strstr(command,"GIVE_CASH") != NULL) {
AddMoneyToPP(atoi(sep.arg[1]));
ps = true;
}
/* Begin GIVE_ITEM */
else if (strstr(command,"GIVE_ITEM") != NULL) {
int16 ItemID = atoi(sep.arg[1]);
sint8 ItemCharges = atoi(sep.arg[2]);
this->SummonItem(ItemID, ItemCharges);
ps = true;
}
/* End GIVE_ITEM */
else if (strstr(command,"CAST_SPELL") != NULL) {
other->CastSpell(atoi(sep.arg[1]),this->GetID());
ps = true;
}

Drawde
01-21-2003, 06:42 AM
Should be a useful addition to the quest scripting system.

I noticed while testing that the GIVE_CASH command doesn't seem to work; is this a known problem?

Lurker_005
01-21-2003, 11:46 AM
Wasn't there a command SPAWN_ITEM or something like that? I don't think it had charges, just wanted to mention it.

mByte
01-21-2003, 12:12 PM
Wasn't there a command SPAWN_ITEM or something like that? I don't think it had charges, just wanted to mention it.

*Edit* Yea, that was there forgot I modified it to spawn an item on the ground rather then your cursor. I just never tested it yet to post it.

I noticed while testing that the GIVE_CASH command doesn't seem to work; is this a known problem?

I tried it and it didnt work correctly either but I can take a look at it after i populate my target zones today.

Trumpcard
01-21-2003, 12:33 PM
Merged it into Wesquests in ST. I'll check give_cash out...

Trumpcard
01-21-2003, 04:21 PM
I was playing with your 260.qst beggar Drawde.. 1st, there should be a space between GIVE_CASH and the value, sep isnt looking over the :

Next, the update packet is never sent to the client after the cash is added, so it's put into the character inventory, but the client is never told.. If you add a few plat then zone, you should see what i mean..

The packet needs to be sent to update the player cash amount on the client, then it will show up immediately.. Probably need to create a seperate function to do that, AddCash that will create and send the update packet structure all in one call...

Not sure what Save() does, it just returns true...