Beggar .js help
Posted: Mon Jan 30, 2006 3:56 am
Ok, it seems nobody has a beggar script, so I think I'll write one now that I've had some experience with the loremaster.
Basically what I envision is something like (onGive) (that fires when an object is given to an NPC)
pseudocode:
Ok, I can figure out rescource destruction form the pgate script, but I'm going to need to know:
1: what event to call when a player drops gold or food on an NPC.
2: Can somebody look in the source code and rip the id hex #s for editible food objects? (I'm assuming it's there, since the computer needs to know what is or isn't food when you eat)
I'd like to be able to give beggars food as well as money.
Thanks!
Basically what I envision is something like (onGive) (that fires when an object is given to an NPC)
pseudocode:
Code: Select all
function onGive(mChar,myNPC,ourOBJ)
{
if (ourOBJ == (goldIdhex#)
{
mChar.karma=mChar.karma+50;
myNPC.TextMessage("Wow, I'm rich now and don't have to live in Minoc slums!");
ourObj=destroyRescourse();
if(ourOBJ==(ediblefoodhex#s)
{ do junk
}
}
//eof
}
}Ok, I can figure out rescource destruction form the pgate script, but I'm going to need to know:
1: what event to call when a player drops gold or food on an NPC.
2: Can somebody look in the source code and rip the id hex #s for editible food objects? (I'm assuming it's there, since the computer needs to know what is or isn't food when you eat)
I'd like to be able to give beggars food as well as money.
Thanks!