Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Today's Posts

 
 
Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 05-26-2001, 12:46 PM
Zayjee Zayjee is offline
Registered User
Join Date: May 2001
Posts: 50
Zayjee is on a distinguished road
Question n00b scripting question no.2

OK. Here goes. I have this meter (originally made by G_Yoshi and edited by me with permission). And what I want it to do when it's full is make the player walk in reverse. I figured I could take Antago's opposite boot script and kinda splice the two. I'll post the two scripts and hope someone can help me out on this.

// NPC made by G_Yoshi, changed by Zayjee with permission
if (playerenters && !isweapon) {
toweapons -DrunkenStatus;
hidelocal;
}

if (created&&isweapon){
setstring oldhpmax,#s(playerfullhearts);
timeout=.05;
}

if (timeout){
Clife();
Gdisplay();
timeout=.05;
}

if (strtofloat(#s(player_drunk))=>100){
setstring player_drunk,100;
set drunkendowed;
---NOTE: This is where I need the opposite boot script---

}

if (playerdies){
Cdead();
}

function Cdead(){
hideimg 202;
hideimg 212;
showstats 1024;
}

function Clife(){
if (strtofloat(#s(player_drunk))>1){
} else if (strtofloat(#s(player_drunk))<=0){

}
if (playerhurt){
dmg = playerhurtpower;
olddrunk = strtofloat(#s(player_drunk));
newdrunk = olddrunk-dmg;
setstring player_drunk,#v(newdrunk);
}
if (strtofloat(#s(player_drunk))>strtofloat(#s(player _drunkmax))){
setstring drunk_limit,#s(player_drunkmax);
}
}

function Gdisplay(){
showstats 2015;
showimg 202,drunk_bar_#s(flavor3).png,425,64;
changeimgpart 202,0,0,166,30;
changeimgvis 202,4;
showimg 212,drunk_bar_#s(flavor3).png,466,72;
changeimgpart 212,0,30,int((strtofloat(#s(player_drunk))/strtofloat(#s(player_drunkmax)))*121)+1,14;
changeimgvis 212,4;
}

that's the meter script, now here's the Opposite Boot script. I NEED THESE PUT TOGETHER.

// Antago Opposite Boots
// My personal favorite pair
// ============================
// Made by Antago of Graal Online
// ============================
// [email protected]
// ============================
// Made for Antago, and all his fanatics!
// ============================
//
// dedicated to Jesus, for taking my
// place on that cross. He died for
// you too, becase He loves you.
//
// ============================
//
//-----To Weapons-----
if (playertouchsme) {
toweapons Opposite Boots;
set gotoppositeboots;
}
//--End To Weapons--
//=================
//-----Usage Of Boots--
if (weaponfired) {
if (this.inuse=0) {
if (strequals(#C3, white)) {
this.bootscolor=1;
}
if (strequals(#C3, yellow)) {
this.bootscolor=2;
}
if (strequals(#C3, orange)) {
this.bootscolor=3;
}
if (strequals(#C3, pink)) {
this.bootscolor=4;
}
if (strequals(#C3, red)) {
this.bootscolor=5;
}
if (strequals(#C3, darkred)) {
this.bootscolor=6;
}
if (strequals(#C3, lightgreen)) {
this.bootscolor=7;
}
if (strequals(#C3, green)) {
this.bootscolor=8;
}
if (strequals(#C3, darkgreen)) {
this.bootscolor=9;
}
if (strequals(#C3, lightblue)) {
this.bootscolor=10;
}
if (strequals(#C3, blue)) {
this.bootscolor=11;
}
if (strequals(#C3, darkblue)) {
this.bootscolor=12;
}
if (strequals(#C3, brown)) {
this.bootscolor=13;
}
if (strequals(#C3, cynober)) {
this.bootscolor=14;
}
if (strequals(#C3, purple)) {
this.bootscolor=15;
}
if (strequals(#C3, darkpurple)) {
this.bootscolor=16;
}
if (strequals(#C3, lightgray)) {
this.bootscolor=17;
}
if (strequals(#C3, gray)) {
this.bootscolor=18;
}
if (strequals(#C3, black)) {
this.bootscolor=19;
}
setshoecolor orange;
this.inuse=1;
timeout=0.05;
this.m=-1;
this.oldx = playerx;
this.oldy = playery;
unset oktouse;
setgif oppositeboots2.gif;
set obootsinuse;
} else {
this.inuse=0;
timeout=0.05;
setgif oppositeboots.gif;
unset obootsinuse;
}
}
if (timeout && this.inuse=1) {
if (playersprite=0 || playersprite>0) {
this.inuse=1;
this.mx=0; this.my=0;
if (playerx<this.oldx) this.mx=this.m;
if (playery<this.oldy) this.my=this.m;
if (playerx>this.oldx) this.mx=-1*this.m;
if (playery>this.oldy) this.my=-1*this.m;
this.dir=10*this.my+this.mx;

//HORIZONTAL movement (X)
this.rx=1;
if (this.mx<0) this.rx=4-1;
if (this.mx>0) this.rx=-1.5-1;
ok=1;
for (i=1;i<=2;i+=.25 {
this.rx+=.25;
for (this.ry=1;this.ry<=2.5;this.ry+=.5) {
if (onwall(playerx+this.rx+this.mx,playery+this.ry)) {
ok=0;
}
}
}
if (ok==1) playerx-=this.mx;

//VERTICAL movement (Y)
this.ry=1;
if (this.my<0) this.ry=4.5-1.5;
if (this.my>0) this.ry=-1-1.5;
ok=1;
for (i=1;i<=3;i+=.25 {
this.ry+=.25;
for (this.rx=.75;this.rx<=2.5;this.rx+=.5) {
if (onwall(playerx+this.rx,playery+this.ry+this.my)) {
ok=0;
}
}
}
if (ok==1) playery-=this.my;

this.oldx = playerx;
this.oldy = playery;
timeout=.05;
}
}
if (timeout && this.inuse=0) {
timeout=0.05;
}
//--End Usage Of Boots--
//-------Feet Colors----------
if (this.inuse=0 && this.bootscolor=1) {
setshoecolor white;
}
if (this.inuse=0 && this.bootscolor=2) {
setshoecolor yellow;
}
if (this.inuse=0 && this.bootscolor=3) {
setshoecolor orange;
}
if (this.inuse=0 && this.bootscolor=4) {
setshoecolor pink;
}
if (this.inuse=0 && this.bootscolor=5) {
setshoecolor red;
}
if (this.inuse=0 && this.bootscolor=6) {
setshoecolor darkred;
}
if (this.inuse=0 && this.bootscolor=7) {
setshoecolor lightgreen;
}
if (this.inuse=0 && this.bootscolor=8) {
setshoecolor green;
}
if (this.inuse=0 && this.bootscolor=9) {
setshoecolor darkgreen;
}
if (this.inuse=0 && this.bootscolor=10) {
setshoecolor lightblue;
}
if (this.inuse=0 && this.bootscolor=11) {
setshoecolor blue;
}
if (this.inuse=0 && this.bootscolor=12) {
setshoecolor darkblue;
}
if (this.inuse=0 && this.bootscolor=13) {
setshoecolor brown;
}
if (this.inuse=0 && this.bootscolor=14) {
setshoecolor cynober;
}
if (this.inuse=0 && this.bootscolor=15) {
setshoecolor purple;
}
if (this.inuse=0 && this.bootscolor=16) {
setshoecolor darkpurple;
}
if (this.inuse=0 && this.bootscolor=17) {
setshoecolor lightgray;
}
if (this.inuse=0 && this.bootscolor=18) {
setshoecolor gray;
}
if (this.inuse=0 && this.bootscolor=19) {
setshoecolor black;
}
//---End Feet Colors----

__________________
-(v)4fu|<13
Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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