Graal Forums

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

Chaos0838 06-15-2002 09:17 AM

NPC Baddie
 
I am trying to make an NPC that will attack people that are not on the VV tag.

For example:
Sting Darkmane(Man with VV tag) and Maximus(no offence Max(No tag)) are in a room together where the Baddie NPCs are. Maximus annoys Sting, so Sting says "Number 1 Attack", which shoots balls at the Maximus. Then he says "Number 1 Chase" which makes the NPC follow Maximus and kill him with his sword.

I have run into a few questions and problens o.o
If the person on the VV tag would say that, would the NPC attack him also? Would the balls be fired at him? Please help me o.o

NPC Code:

// NPC made by Vlåd Hasimir ¤Øççûlt¤ (VV)

if (created) {
// Initialize the attributes
showcharacter;
setcharprop #3,head711.png;
setcharprop #C0,black;
setcharprop #C1,gray;
setcharprop #C2,black;
setcharprop #C3,black;
setcharprop #C4,black;
setcharprop #2,no-shield.gif;
setcharprop #8,body13.png;
setcharprop #1,noxdagger-sword.png;
shieldpower = 3;
dir = 2;
dontblock;
blockagain;
}
if (playerchats && strequals(#c,Number 1 Attack)){
if (!charge1 && strequals(#g,VV)){
set attack1;
}
}

if (playerchats && strequals(#c,Stop Attack 1)){
if (strequals(#g,VV)){
unset attack1;
sprite=0;
}
}

if (playerchats && strequals(#c,Number 1 Charge)){
if (!attack1 && strequals(#g,VV)){
set charge1;
}
}
if (playerchats && strequals(#c,Stop Charge 1)){
if (strequals(#g,VV)){
sprite=0;
x=33;
y=22;
unset charge1;
dir = 2;
dontblock;
blockagain;
}
}
if (strequals(#g,VV)){
if (attack1){
sleep.1;
sprite=25;
sleep .1;
sprite=24;
sleep.1;
timeout = .5 ;
}
}
if (strequals(#g,VV)){
if (charge1){
followplayer;
timeout=1;
}
}
if (timeout){
if (attack1){
sprite=23;
shootball;
timeout = .5;
}
if (charge1){
setcharani sword, gani;
sprite=11;
play sword.wav;
hitplayer 0,1,playerx,playery;
}
}


Dragona2002 06-15-2002 08:14 PM

= /

Dragona2002 06-15-2002 08:15 PM

i asked loriel to fix = )

AlexH 06-15-2002 08:39 PM

Wouldn't functions make that script look less messy?

Dragona2002 06-15-2002 08:44 PM

srry i know im a noob but...........
what is a function ???
the same as an tag or somthing like an Event ?

RavenTelvecho 06-15-2002 09:42 PM

it would not work.. youd need to use a for loop in the level..


All times are GMT +2. The time now is 08:58 AM.

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