Question ABout Prize NPC

10/26/2009 03:55 edgdro2#1
Does anyone know how to get the prize npc to give the items that they have one?
I really need help Please reply!
10/26/2009 03:56 blade911#2
I never say this but use, "search" for "npc that gives items". It works I've done it. Pretty simple.
10/26/2009 04:00 .Matt#3
I remember seeing something about the prize npc and what not in the Paze Co source when I was going through it, I don't know if it actually worked or anything but maybe look through that source.
10/26/2009 04:18 edgdro2#4
OKay thanks. I have him working but i want to be able to give an acccount a certain item and them go to him to get it
@blade im not dumb ive got plenty of those its just i want prize npc to work
10/26/2009 04:33 raidenx123#5
well you have to make the NPC check if the player has the itemID in his inventory, then if he does put up the dialog and award the item, maybe like this:
Code:
if Control = 1;
{
// Check for the item in inventory
{
Text("Thank you for your item, here ill reward you with a meteor!");
Link("Thanks." 255);
AwardItem(1088001-0-0-0-0-0, 0)//theres more to this....
}
else
{
Text("Sorry you dont have the required item");
Link("Darnskies" 255);
its a structure not the actual code
10/26/2009 04:50 blade911#6
Quote:
Originally Posted by edgdro2 View Post
t
@blade im not dumb ive got plenty of those its just i want prize npc to work
I didn't say you were dumb.
10/26/2009 14:07 edgdro2#7
@blade: Well I have made npcs.
@raiden: Will that work for 5095 because my npcs for 5095 arent coded like that.
10/27/2009 05:23 .Matt#8
Quote:
Originally Posted by edgdro2 View Post
@blade: Well I have made npcs.
@raiden: Will that work for 5095 because my npcs for 5095 arent coded like that.
Sure it would, you would just need to put it the way yours(or CoEmu I believe) is written.
10/27/2009 16:04 pro4never#9
Could be two ways you want it done.

#1 Predetermined items (db's? pre-set items?) for players with a certain database value (such as donation, won a pk event, was awarded by gm etc)

In that case add a database value for it such as Prize and have it = True through some function (gm command is easy enough to do, or a web based donation system, or the ever simple ingame reward for events)

Then have it donated.

You could also do a really neat system by creating a new table in the database where it stores player id, item number, +, bless, enchant, sockets etc. That way you can have a player command OR donation based system where it changes the reward to ANYTHING you want and then the npc simply loads out of the database what to give you and then clears it from database (so you can't claim more than once)

The benefits for the second system would be you could do a player command that functions exactly like /item except it has a target player name. That will then allow the player to claim the item when they come online (would be useful to add a check when they logon to see if they have anything to claim and alert the player via msg's)
10/27/2009 18:21 edgdro2#10
WOw thanks I think i will add the second one.
10/27/2009 18:55 pro4never#11
Quote:
Originally Posted by edgdro2 View Post
WOw thanks I think i will add the second one.
Second one would be a bit harder to code but just remember, you already have examples of just about every section of code required.

#1: Getting player target name (Look at any gm command that targets a player such as kick, bringmeto/bringtome, ban etc)

#2: Spawning item stats: Just check the add item code and instead load it from database

#3: Saving to database: Make the gm command save it to the database for the target id


Only one that wouldn't have some sort of example out there as far as I can think of is a web based donation system (so you could let players create their own specific items for x amount of donation *cough* selling *cough* and then it save to database...) That part would be far more complicated though.
10/27/2009 21:25 Fish*#12
Quote:
Originally Posted by pro4never View Post
Could be two ways you want it done.

#1 Predetermined items (db's? pre-set items?) for players with a certain database value (such as donation, won a pk event, was awarded by gm etc)

In that case add a database value for it such as Prize and have it = True through some function (gm command is easy enough to do, or a web based donation system, or the ever simple ingame reward for events)

Then have it donated.

You could also do a really neat system by creating a new table in the database where it stores player id, item number, +, bless, enchant, sockets etc. That way you can have a player command OR donation based system where it changes the reward to ANYTHING you want and then the npc simply loads out of the database what to give you and then clears it from database (so you can't claim more than once)

The benefits for the second system would be you could do a player command that functions exactly like /item except it has a target player name. That will then allow the player to claim the item when they come online (would be useful to add a check when they logon to see if they have anything to claim and alert the player via msg's)
You always come with very good explanations, very good :)