Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   NPC Scripting (https://forums.graalonline.com/forums/forumdisplay.php?f=8)
-   -   having an item, and giving it (https://forums.graalonline.com/forums/showthread.php?t=24495)

ArchOwl 02-24-2002 08:10 PM

having an item, and giving it
 
im trying to make a mushroom script, where you can make potions and sell them or keep them for use

does !hasmushroom work as having the mushroom?
and if so, would something like

if !hasmushroom;
(command to activate something)

work?

Lomgren 02-24-2002 11:54 PM

that would work, just set the flag when the player gets the mushroom. Of course sometimes the flag won't set and I forget how to keep that from happening....

Faheria_GP2 02-24-2002 11:59 PM

well, to have an item, and give it, you would include something like this (we are assuming that this is non-P2P, and the weapon's name is "*****")

the files we are using is

*****.txt (shown below)
*****icon.gif (make one yourself)

NPC Code:

//*****.txt
if (!isweapon) {
if (playertouchsme) {
toweapons *****;
destroy;
}
}else{
if (playerchats && strequals(#c,Drop *****)) {
putnpc *****icon.gif,*****.txt,playerx+1.5-2/2+vecx(playerdir),playery+2-2/2+vecy(playerdir);
//Make a non-weapon duplicate of self on level
destroy; //Remove weapon
}
if (weaponfired) blahblahblah();
}



next time I will show you for P2P

btedji 02-25-2002 03:40 AM

Quote:

Originally posted by Faheria_GP2
well, to have an item, and give it, you would include something like this (we are assuming that this is non-P2P, and the weapon's name is "*****")

the files we are using is

*****.txt (shown below)
*****icon.gif (make one yourself)

NPC Code:

//*****.txt
if (!isweapon) {
if (playertouchsme) {
toweapons *****;
destroy;
}
}else{
if (playerchats && strequals(#c,Drop *****)) {
putnpc *****icon.gif,*****.txt,playerx+1.5-2/2+vecx(playerdir),playery+2-2/2+vecy(playerdir);
//Make a non-weapon duplicate of self on level
destroy; //Remove weapon
}
if (weaponfired) blahblahblah();
}



next time I will show you for P2P

I think you should have done a better example =D

Faheria_GP2 02-26-2002 06:50 AM

I couldn't think of a good name for an example item :o

Bhala 02-26-2002 07:08 AM

its better to use a seperate NPC to control droping... like g2k1 does with the Item helper... & use action like "actiondropsnowcone" & in the NPC you check if that player has more then one & if not delete it & lay a new NPC.....

Faheria_GP2 02-26-2002 09:00 AM

usually when people ask me for scripts, I assume it's for non-p2p...but yes, you are right...

ArchOwl 02-26-2002 09:53 AM

Quote:

Originally posted by Faheria_GP2
usually when people ask me for scripts, I assume it's for non-p2p...but yes, you are right...
well see im trying to make this script for 2k1, the graphics are not a problem, nor levels, but since it shouldnt be that hard of a script im tryin to make it myself

what would be a p2p example of the last one you showed me?


All times are GMT +2. The time now is 10:38 PM.

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