Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   Trading? (https://forums.graalonline.com/forums/showthread.php?t=22837)

lordhelmut 02-02-2002 03:04 PM

Trading?
 
What would be the best way to go about making a trade item for a free server? I was trying to think how to do it and I figured...

1.Text File for each droppable NPC
2.Use PutNPC when fired
3.Find out how to make it destroy the item in the weapons list once dropped

any help?

lordhelmut 02-02-2002 11:56 PM

help me please =(

mhermher 02-03-2002 03:19 AM

Quote:

Originally posted by lordhelmut
help me please =(
Use keydown... when keydown detected to
putnpc... in the putnpc do if playerthouch me destroy etc.

LiquidIce00 02-03-2002 05:13 AM

I dont recommend using Putnpc .
b/c if 2 ppl touch it at the same time, they will both get the item.
Its hard to make trading stuff for non p2p .
I would use something like putnpc but making the players separated so they can not both touch the putnpc at the time

nyghtGT 02-03-2002 05:19 AM

Quote:

Originally posted by LiquidIce00
I dont recommend using Putnpc .
b/c if 2 ppl touch it at the same time, they will both get the item.
Its hard to make trading stuff for non p2p .
I would use something like putnpc but making the players separated so they can not both touch the putnpc at the time

I agree, unlike 2001, you can't make an NPC for each
individual hat go everywhere.

Goboom 02-03-2002 05:20 AM

im sure there is a complicated script you could do with arrays

TDK_RC6 02-03-2002 08:19 AM

well, lets see


if (created) {
this.playerid=-1; }
if (playertouchsme&&this.playerid==-1) {
this.playerid=playerid;
if (this.playerid==playerid) {
toweapons ....; }
}

LiquidIce00 02-03-2002 09:13 AM

Quote:

Originally posted by TDK_RC6
well, lets see


if (created) {
this.playerid=-1; }
if (playertouchsme&&this.playerid==-1) {
this.playerid=playerid;
if (this.playerid==playerid) {
toweapons ....; }
}

doesnt matter.
Because the this.playerid would be local. So if 2 people touched at the same time it would give this.playerid to both of them .. hehe .its a b*tch i know

u can do w/ save[0] variables. but even those take a second or two to send to the server.
So its not as ez as it looks to make these things on free

TDK_RC6 02-03-2002 11:00 AM

Quote:

Originally posted by LiquidIce00


doesnt matter.
Because the this.playerid would be local. So if 2 people touched at the same time it would give this.playerid to both of them .. hehe .its a b*tch i know

u can do w/ save[0] variables. but even those take a second or two to send to the server.
So its not as ez as it looks to make these things on free

well darn, i didnt know that it was local, o well

royce 02-03-2002 02:07 PM

Quote:

Originally posted by LiquidIce00


doesnt matter.
Because the this.playerid would be local. So if 2 people touched at the same time it would give this.playerid to both of them .. hehe .its a b*tch i know

u can do w/ save[0] variables. but even those take a second or two to send to the server.
So its not as ez as it looks to make these things on free

What do you exactly mean local? Be specific plz.

Faheria_LAT1 02-03-2002 02:29 PM

Eye Dee Ah (Idea you *****s)

Make a trade house in which each player enters a secured area (blocking tiles with a door =P). When both players say 'start trade' the doors would close. Each player would lay the item and then when both say 'trade' or 'accept' they get switched from one 'trade box' to the other.

Of course doing this with gralats wont be easy because they can disappear after a short time..

royce 02-03-2002 03:04 PM

Quote:

Originally posted by Faheria_LAT1
Eye Dee Ah (Idea you *****s)

Make a trade house in which each player enters a secured area (blocking tiles with a door =P). When both players say 'start trade' the doors would close. Each player would lay the item and then when both say 'trade' or 'accept' they get switched from one 'trade box' to the other.

Of course doing this with gralats wont be easy because they can disappear after a short time..

We arnt totally stupid here. What if you were in a level where another person is that took you 20 minutes to get too and then you wanted to give him something so he could progress on. Think of realism here. Duh....there is prolly a better exmplanation of what i said but its 3 am...

joseyisleet 02-03-2002 04:41 PM

I would put all of the NPCs that you use into seperate text files for the stuff. Put like a bank item in the trading house, then, if they say "trade <npchere> spot1" and the other person says "trade <npchere> spot2". Then, make it so they have to accept then have it destroy it in the players weapon list and use putnpc to put it in front of them. With the bank use something like "<ammounthere> for spot1" or vica versa. Then it drops the ammount into spot 1 or 2. It may be laggy, but, it should work. As for the trading item itself, it would be kind of hard, because, if the person "lagged" and someone else came by, they both would get it.

royce 02-04-2002 01:17 AM

There is no way whatsoever to check and see if the npc was recieved in 2 parcels in 1 level on a non-p2p server? There has to be a way of checking for this.

lordhelmut 02-04-2002 01:30 AM

hmmm the main problem is destroying it in the droppers weapons list

Goboom 02-04-2002 01:59 AM

y dont you use this. in the weapon of the player like
if (this.traded=1){
destroy;}
therefore it destroys the weapon

royce 02-04-2002 02:32 AM

Quote:

Originally posted by Goboom
y dont you use this. in the weapon of the player like
if (this.traded=1){
destroy;}
therefore it destroys the weapon

erm try

NPC Code:

if (this.traded<=1) {
this.item--;
destroy;
}


something like that?

LiquidIce00 02-04-2002 03:10 AM

Quote:

Originally posted by Faheria_LAT1
Eye Dee Ah (Idea you *****s)

Make a trade house in which each player enters a secured area (blocking tiles with a door =P). When both players say 'start trade' the doors would close. Each player would lay the item and then when both say 'trade' or 'accept' they get switched from one 'trade box' to the other.

Of course doing this with gralats wont be easy because they can disappear after a short time..

if the player left the level and the npc was laid, it would stay there. You cant save the person who laids acct name in any way and the script would run for the other person . he could just go there and get it.

LiquidIce00 02-04-2002 03:11 AM

Quote:

Originally posted by lordhelmut
hmmm the main problem is destroying it in the droppers weapons list
you could do like
if (destroynpc) { destroy; }
in the tradable npc's.. then have in the trader
for (this.i=0;this.i<weaponscount;this.i++) {
if (strequals(#w(this.i),Fireball)) { callweapon this.i,destroynpc; }
}
or something like that. (where fireball is the npc ur trading)


All times are GMT +2. The time now is 09:27 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.