Get your own Chat Box! Go Large!
ChassyScape Forums
November 22, 2009, 06:21:55 am
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Remember, downloads MUST have a virus scan.
 
  Home Help Search Arcade Staff List Login Register  

Case 57: //Use item on NPC - Setting the variables for it to work[look inside]


Pages: [1]
  Print  
Author Topic: Case 57: //Use item on NPC - Setting the variables for it to work[look inside]  (Read 229 times)
Chassy
Administrator
Fairly Good Poster
*

Rep: 71
Posts: 156


^Damn best Drawing you'll see.

mopar_god@hotmail.com
View Profile
« on: January 19, 2009, 05:09:48 pm »

Well, I have decided to get off my ass and start working on that Summoning Project I promised you guys a few months ago. I just found a code snippet to replace my packet 57, which is using items on npcs. Unfortunately, when I specify the NPC I ONLY want it to work on, your character will not do anything. He just sits there.


So....here is my packet 57:

Code:
        case 57:  // Use item on npc
                int ItemUsed = inStream.readUnsignedWordA();
                int NpcUsedOn = inStream.readSignedWordBigEndianA();//inStream.readUnsignedWordA(); tells which npc by order in list. 1 = first npc spawned ?
                switch(ItemUsed) {
                        case 4151:
                                sendMessage("Whip.");
                        break;

case 15255:
if (NpcUsedOn == 409) {
customCommand("train");
}
break;

                        default:
                                sendMessage("Nothing interesting happens.");
                        break;
                }
        break;

The variables being used to specify the npc:

Code:
int NpcUsedOn = inStream.readSignedWordBigEndianA();


So does anyone know what's wrong? It won't do anything, BUT there are NO compile errors. Do I have the wrong variable being used, or what am I missing?

-Thanks


DO NOT REPLY UNLESS YOU HAVE A GUESS, SPAM POSTS WILL BE REMOVED AND YOU WILL BE WARNED.
Report Spam   Logged

Pharos you're going to fucking die for stealing my lucky charms!@#!#

USE THE REPORT TO A MODERATOR BUTTON ON THE POST!!!!!!!!!
Pharos
ChassyScape In-Game Admin
Fairly Good Poster
*

Rep: 4
Posts: 131



View Profile
« Reply #1 on: January 22, 2009, 07:33:37 pm »

I would think that it has something to do with the variable declaration, as the switch looks fine. You can always turn to mopar if you need to.
Report Spam   Logged

Chassy
Administrator
Fairly Good Poster
*

Rep: 71
Posts: 156


^Damn best Drawing you'll see.

mopar_god@hotmail.com
View Profile
« Reply #2 on: January 22, 2009, 09:54:17 pm »

I would think that it has something to do with the variable declaration, as the switch looks fine. You can always turn to mopar if you need to.

I have. The only problem is it is full of complete retards.
Report Spam   Logged

Pharos you're going to fucking die for stealing my lucky charms!@#!#

USE THE REPORT TO A MODERATOR BUTTON ON THE POST!!!!!!!!!
Pharos
ChassyScape In-Game Admin
Fairly Good Poster
*

Rep: 4
Posts: 131



View Profile
« Reply #3 on: January 22, 2009, 10:04:33 pm »

I would think that it has something to do with the variable declaration, as the switch looks fine. You can always turn to mopar if you need to.

I have. The only problem is it is full of complete retards.

Yeah, I guess you are right. "Wuts a Java?", "Hao do i opun client.java?", "HELP PLZ I GET ERROR FROM COMPILE!!!!!!!!!!".

I'll look into it a little more if I can. I'm not too knowledgeable when it comes to handling packets though.

Report Spam   Logged

Lucius261
ChassyScape In-Game Admin
Fairly Good Poster
*

Rep: 5
Posts: 233


lucius261@live.com
View Profile WWW Email
« Reply #4 on: April 01, 2009, 01:16:37 pm »

I would think that it has something to do with the variable declaration, as the switch looks fine. You can always turn to mopar if you need to.

Mopar sucks...
Try Rune-Server
Report Spam   Logged



Get Photoshop Cs3 Extended here!
Pages: [1]
  Print  
 
Jump to:  

Powered by EzPortal

Bookmark this site! | Upgrade This Forum
SMF For Free - Create your own Forum

Powered by SMF | SMF © 2006, Simple Machines LLC
ServerBeach Coupon