NPC repair

Welcome in the osRose emulator Project.

Moderators: osRose dev team, ospRose dev team, osiRose dev team, Moderators

NPC repair

Postby PurpleYouko on Thu Sep 11, 2008 7:45 pm

First the good news.

I have got some of the NPCs to actually repair my stuff.

The bad news (not really all that bad i guess) is that I don't know all the NPCs that can actually fix stuff.
I have Ronk in Adventurer's plains and raffle in Zant both working but i have no idea what other NPC need to be set up too.

The thing is that each NPC returns a unique ID code in the packet.
For some reason in osProse we use a switch function to work this with individual cases so if the wrong code comes in, nothing happens.

In osrose they don't do the switch thing at all. the downside is that if we drop the NPC code check and just run the repair code anyway, then we lose a layer of protection against hackers.

So what i need is a list of all the NPCs that can fix your stuff, then I can go and find out what value they are sending in. ;)
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: NPC repair

Postby Ghost_Dragon on Thu Sep 11, 2008 11:52 pm

I got these to working after a little help from Arnold in my iRose server. I might be able to help you with it, if you can post the portions of code so I can compare it to what I did to get mine working.

This are the NPCs that repair items:
Crune - Junon
Ronk - Adventurer's Plains
Raffle - Zant
Pavrick - Eucar
Nel Eldora - Xita

These are the NPCs that sell the repair tools:
Carrion - Zant
Saki - Junon
------------------>SEARCH<-------------------
Image
User avatar
Ghost_Dragon
Pomic
Pomic
 
Posts: 132
Joined: Fri Feb 29, 2008 9:38 am
Location: Home of Superbowl 43 Champs.

Re: NPC repair

Postby PurpleYouko on Fri Sep 12, 2008 1:56 pm

thanks for the list.

Some of those don't seem to offer the repair option in osprose though.
Crune and pavrik didn't even give me the choice to repair items in my test server when i spoke to them

actually making the NPCs do the repair is pretty easy.
the code in osprose is this
  1.  
  2. // Repair npc
  3. bool CWorldServer::pakRepairItem( CPlayer* thisclient, CPacket* P )
  4. {
  5.     BYTE action = GETBYTE((*P),0);
  6.     switch(action)
  7.     {
  8.         case 0x61: //Ronk
  9.         case 0x3d:
  10.         case 0x39:
  11.         case 0x1c:
  12.         case 0x08:
  13.         case 0x74:
  14.         case 0x89:
  15.         case 0x12: // Raffle
  16.         case 0x43: //NPC Repair Item / Town
  17.         {
  18.             BYTE slot = GETBYTE((*P),2);
  19.             if(!CheckInventorySlot( thisclient, slot)) return false;
  20.             if(thisclient->items[slot].count<1) return true;
  21.             //Log( MSG_INFO,"Item socketed?: %i", thisclient->items[slot].socketed);
  22.             thisclient->items[slot].lifespan = 100;
  23.             //Log( MSG_INFO,"Item socketed?: %i", thisclient->items[slot].socketed);
  24.             //Still TODO: find where prices of storage and repair are and add it to the code.
  25.             BEGINPACKET( pak, 0x7cd );
  26.             ADDQWORD   ( pak, thisclient->CharInfo->Zulies );
  27.             ADDBYTE    ( pak, 0x01 );
  28.             ADDBYTE    ( pak, slot );
  29.             ADDWORD   ( pak, BuildItemHead( thisclient->items[slot] ));
  30.             ADDDWORD   ( pak, BuildItemData( thisclient->items[slot] ));
  31.             ADDBYTE    ( pak, 0x00 );
  32.             thisclient->client->SendPacket( &pak );
  33.             thisclient->SetStats( );
  34.         }
  35.         break;
  36.         default:
  37.             Log( MSG_WARNING,"Repair Item unknown action: %i", action);
  38.     }
  39.     return true;
  40. }

The Raffle and Ronk entries are ones i added yesterday.
Whenever the client sends a 0x07cd packet, this code reads the "action" byte from it and compares this to the code that should be returned by the NPC fixing the item.
If a code is not listed then it is thrown up as a warning message in the server. All you have to do then is add that number to the list and recompile, then from that point on it will work for that NPC. ;)
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: NPC repair

Postby Drakia on Fri Sep 12, 2008 4:10 pm

Just so you know PY, the Storage/repair prices aren't stored anywhere, they're generated using equations.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: NPC repair

Postby PurpleYouko on Fri Sep 12, 2008 4:19 pm

Drakia wrote:Just so you know PY, the Storage/repair prices aren't stored anywhere, they're generated using equations.


And won't that be fun :?
Need to lookup information on NARose items, skills, quests?
Now featuring a newly completed skill tree for all classes
Formatting fixed for different resolutions
Image

"A Gazelle is nothing but a giraffe plotted logarithmicaly"
User avatar
PurpleYouko
Rose Guru
Rose Guru
 
Posts: 4733
Joined: Fri Aug 10, 2007 2:05 pm

Re: NPC repair

Postby Rescudo on Fri Sep 12, 2008 4:22 pm

I pity the person who has/had to reverse these formulas. :lol:
SEARCH - it's there for a reason!
User avatar
Rescudo
El Verloon Marshall
El Verloon Marshall
 
Posts: 872
Joined: Tue Mar 11, 2008 7:20 am

Re: NPC repair

Postby Drakia on Fri Sep 12, 2008 5:18 pm

The storage one is already in the client, just not used (I added it a while back, got it from ExJam) Or atleast it should be, I don't think I took it out.
My favorite skill is scaring new users away.
If you haven't SEARCHED expect me to yell at you.
Image
Drakia
ospRose dev team
ospRose dev team
 
Posts: 1614
Joined: Tue Sep 18, 2007 6:53 am
Location: Nanaimo, BC, Canada

Re: NPC repair

Postby lmame on Fri Sep 12, 2008 7:19 pm

If I remember correctly the storage fee was just a % from original item price.
The world is full of love and peace ^_^
Image
User avatar
lmame
Admin
Admin
 
Posts: 8997
Joined: Mon Aug 06, 2007 4:42 pm
Location: July City

Re: NPC repair

Postby Rescudo on Fri Sep 12, 2008 8:42 pm

I was looking at the NPC price formula in osROSE the other day ... that was slightly more complicated than a percentage. If the other formulas in ospROSE are going to be anything like that, I definitely do not envy whoever is going to try and figure them out :)
SEARCH - it's there for a reason!
User avatar
Rescudo
El Verloon Marshall
El Verloon Marshall
 
Posts: 872
Joined: Tue Mar 11, 2008 7:20 am

Re: NPC repair

Postby Ghost_Dragon on Fri Sep 12, 2008 8:49 pm

@PY....code looks just like mine....I had to add the missing case numbers in...so we are identical there.

I'm an not sure what you mean by losing a layer of protection from hackers. Can you elaborate a little bit on that...because if thats the case I need to go back in and look at my code. But as far as what you just posted...we are the same...only because of the pointer Arnold gave me about just adding the missing case numbers....though I am still looking through because it just doesn't seem that it was that simple. Maybe that ties in with what you are saying about losing protection.
------------------>SEARCH<-------------------
Image
User avatar
Ghost_Dragon
Pomic
Pomic
 
Posts: 132
Joined: Fri Feb 29, 2008 9:38 am
Location: Home of Superbowl 43 Champs.

Next

Return to Support - OspRose Emulator

Who is online

Users browsing this forum: No registered users and 4 guests