Graal Forums

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

Blaikie 11-14-2001 04:57 AM

Medal Maker
 
I am making an NPC that lays Gold, Silver and Bronze NPC medals.

The medals are just for show in the players inventory it's mainly for my guild but i'm having some problems with certain areas.

It's just a simple script, I can get the NPC to lay all the medals
but only once and then never again! I am also trying to make it so that I can only operate the NPC and no one else.
It would be great if someone could help me out.

-Lay the medals more than once!
-Only I can operate the NPC!


Medal layer -

if (playerenters && !strequals(#a,this.owner))
setlevel2 houseoutside.graal,35.5,14;

if (playerenters) {show;
}
if (playerchats&&strequals(#c,Gold Medal) {
show();

}

if (playerenters&&!strequals(#a,this.owner))
setlevel2 houseoutside.graal,35.5,14;

if (playerenters) {show;
}
if (playerchats&&strequals(#c,Silver Medal) {
show();



}

if (playerenters&&!strequals(#a,this.owner))
setlevel2 houseoutside.graal,35.5,14;

if (playerenters) {show;
}
if (playerchats && strequals(#c,Bronze Medal) {
show();



Medals -



if (playerenters) {
}
if (playertouchsme) {
}

if (playerenters) hide;
if (strcontains(#c,Gold Medal)) show;



if (playerenters) {
}
if (playertouchsme) {
dontblock;
toweapons Gold Medal;
toinventory flag;
hide;
}

if (weaponfired) {
say2 This is a Gold Medal!;
i = strtofloat(#s(Ammo)) - 1;
play goal.wav;
if (i == 0) {
setstring Ammo,;


}
setstring Ammo,#v(i);
}

if (weaponfired)
damage = 1.damage;
damagegetype = 1;
this.active = 1;




The silver and bronze medals are just the same as above.

Poogle 11-14-2001 05:15 AM

Re: Medal Maker
 
Quote:

Originally posted by Blaikie
I am making an NPC that lays Gold, Silver and Bronze NPC medals.

The medals are just for show in the players inventory it's mainly for my guild but i'm having some problems with certain areas.

It's just a simple script, I can get the NPC to lay all the medals
but only once and then never again! I am also trying to make it so that I can only operate the NPC and no one else.
It would be great if someone could help me out.

-Lay the medals more than once!
-Only I can operate the NPC!


Medal layer -

if (playerenters && !strequals(#a,this.owner))
setlevel2 houseoutside.graal,35.5,14;

if (playerenters) {show;
}
if (playerchats&&strequals(#c,Gold Medal) {
show();

}

if (playerenters&&!strequals(#a,this.owner))
setlevel2 houseoutside.graal,35.5,14;

if (playerenters) {show;
}
if (playerchats&&strequals(#c,Silver Medal) {
show();



}

if (playerenters&&!strequals(#a,this.owner))
setlevel2 houseoutside.graal,35.5,14;

if (playerenters) {show;
}
if (playerchats && strequals(#c,Bronze Medal) {
show();



Medals -



if (playerenters) {
}
if (playertouchsme) {
}

if (playerenters) hide;
if (strcontains(#c,Gold Medal)) show;



if (playerenters) {
}
if (playertouchsme) {
dontblock;
toweapons Gold Medal;
toinventory flag;
hide;
}

if (weaponfired) {
say2 This is a Gold Medal!;
i = strtofloat(#s(Ammo)) - 1;
play goal.wav;
if (i == 0) {
setstring Ammo,;


}
setstring Ammo,#v(i);
}

if (weaponfired)
damage = 1.damage;
damagegetype = 1;
this.active = 1;




The silver and bronze medals are just the same as above.

Firsit oh all you need { and }

SlayerOfDarkness 11-14-2001 10:52 AM

Nice idea on the medal thing ;)
 
good idea for that medal thing heh heh

TDK_Admin1 11-14-2001 08:52 PM

Re: Nice idea on the medal thing ;)
 
Quote:

Originally posted by SlayerOfDarkness
good idea for that medal thing heh heh
*watchers slayer copy and paste the script into level editor*

entravial 11-15-2001 10:33 AM

~AlphaFlame~

I rarely suggest this, but you might want to consider just using putnpc for that... unless you know arrays enough to do it that way... :-P

Redwizard 11-16-2001 04:29 AM

Or a simple way of tiying it up is to create the medal script itslef on a .txt file in your graal folder, and then have ur usual weaponfired script like:
if (weaponfired) {putnpc gfx.gif,medal.txt,x,y,;
}
that will take care of your laying only once problem. sry, but thats all i know

entravial 11-16-2001 04:52 AM

~AlphaFlame~

I just noticed... but why oh why are you using a variable to keep track of how many medals you have? You could easily solve that problem by using:

toweapons /the-medal; (yes, include the /)

and

if (weaponfired){
blahblah;
destroy;
}

Blaikie 11-17-2001 06:13 AM

Thanks for the help everyone! =)


I will try these methods and see if they work


All times are GMT +2. The time now is 11:55 AM.

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