You last visited: Today at 09:18
Advertisement
5517-Magic Artisan messes with attack when upgrading level
Discussion on 5517-Magic Artisan messes with attack when upgrading level within the CO2 Private Server forum part of the Conquer Online 2 category.
01/11/2013, 11:02
#1
elite*gold: 0
Join Date: Jan 2013
Posts: 62
Received Thanks: 8
5517-Magic Artisan messes with attack when upgrading level
Hello guys
i discovered a bug on my magic artisan, and because i'm not a pro coder yet (only 2 weeks of learning) i couldn't solve the problem or figure out where it comes from
i'm not used to that kind of codes(too difficult for me), my first interest is knowing how is that npc working and how that bug is happening, then fix it
after upgrading the item level many times(everytime, the attack madly decreases) i end up with this
this is the npc code:
PHP Code:
#region Magic Artisan case 10062 : { switch ( npcRequest . OptionID ) { case 0 : { dialog . Text ( "Hello! I can always succeed in upgrading item quality as i´ve penetrated the mystery of their powers." ); dialog . Text ( "But I`II ask for a few more dragon balls tha Artisan Wind." ); dialog . Text ( "I can also upgrade or lower item levels. How can I help you?" ); dialog . Option ( "Upgrade The Quality." , 3 ); dialog . Option ( "Upgrade The Level." , 1 ); dialog . Option ( "Lower Equipment Level." , 2 ); dialog . Send (); break; } case 1 : case 2 : case 3 : { int aut = npcRequest . OptionID * 10 ; dialog . Text ( "Select which item's details you want to change?" ); dialog . Option ( "Headgear." , ( byte )( aut + 1 )); dialog . Option ( "Necklace/Bag." , ( byte )( aut + 2 )); dialog . Option ( "Armor." , ( byte )( aut + 3 )); dialog . Option ( "Main Weapon." , ( byte )( aut + 4 )); dialog . Option ( "Left Weapon/Shield." , ( byte )( aut + 5 )); dialog . Option ( "Heavy Ring, Ring, Bracelet." , ( byte )( aut + 6 )); dialog . Option ( "Boots." , ( byte )( aut + 8 )); dialog . Option ( "No need thanks" , 255 ); dialog . Send (); break; } case 100 : { if ( client . SelectedItem == 0 ) return; var item = client . Equipment . TryGetItem ( client . SelectedItem ); var itemdetail = Conquer_Online_Server . Database . ConquerItemInformation . BaseInformations [ item . ID ]; Conquer_Online_Server . Database . ConquerItemInformation infos = new Conquer_Online_Server . Database . ConquerItemInformation ( item . ID , item . Plus ); switch ( client . UpdateType ) { case 1 : case 2 : { //Cost: 36 //Metscrolls: 4 byte cost = ( byte )( itemdetail . Level / 5 ); byte scrolls = 0 ; bool useScrolls = false ; byte extraScroll = 0 ; int addMets = 0 ; cost += ( byte )(( item . ID % 10 ) / 3 ); cost += ( byte )( itemdetail . Level / 10 ); uint id = 1088001 ; if ( client . UpdateType == 2 ) id ++; foreach ( IConquerItem scroll in client . Inventory . Objects ) if ( scroll . ID == 720027 ) scrolls ++; if ( cost % 10 != 0 ) { addMets = 10 - ( cost % 10 ); extraScroll = 1 ; } if ( scrolls >= ( cost / 10 ) + extraScroll ) useScrolls = true ; if ( client . Inventory . Contains ( id , cost ) || useScrolls ) { if ( useScrolls ) { client . Inventory . Remove ( 720027 , Convert . ToByte (( cost / 10 ) + extraScroll )); client . Inventory . Add ( 1088001 , 0 , ( byte ) addMets ); } else client . Inventory . Remove ( id , cost ); client . UnloadItemStats ( item , false ); if ( client . UpdateType == 1 ) { Conquer_Online_Server . Database . ConquerItemInformation infos2 = new Conquer_Online_Server . Database . ConquerItemInformation ( infos . CalculateUplevel (), item . Plus ); if ( infos2 . BaseInformation . ID == infos . BaseInformation . ID ) return; if ( client . Entity . Level < infos2 . BaseInformation . Level ) { dialog . Text ( "You need level " + infos2 . BaseInformation . Level + " first." ); dialog . Option ( "Ahh sorry." , 255 ); dialog . Send (); client . SelectedItem = 0 ; client . UpdateType = 0 ; return; } item . ID = infos . CalculateUplevel (); } else item . ID = infos . CalculateDownlevel (); Conquer_Online_Server . Database . ConquerItemTable . UpdateItemID ( item , client ); item . Mode = Conquer_Online_Server . Game . Enums . ItemMode . Update ; item . Send ( client ); _String str = new _String ( true ); str . UID = client . Entity . UID ; str . TextsCount = 1 ; str . Type = _String . Effect ; str . Texts . Add ( "perfect" ); client . Screen . SendScreen ( str , true ); client . LoadItemStats ( item ); client . Equipment . UpdateEntityPacket (); } break; } case 3 : { byte cost = ( byte )( itemdetail . Level / 30 ); cost += ( byte )(( item . ID % 10 ) / 2 ); uint id = 1088000 ; if ( client . Inventory . Contains ( id , cost )) { client . Inventory . Remove ( id , cost ); client . UnloadItemStats ( item , false ); if ( item . ID % 10 < 5 ) item . ID += 5 - item . ID % 10 ; item . ID ++; Conquer_Online_Server . Database . ConquerItemTable . UpdateItemID ( item , client ); item . Mode = Conquer_Online_Server . Game . Enums . ItemMode . Update ; item . Send ( client ); _String str = new _String ( true ); str . UID = client . Entity . UID ; str . TextsCount = 1 ; str . Type = _String . Effect ; str . Texts . Add ( "perfect" ); client . Screen . SendScreen ( str , true ); client . LoadItemStats ( item ); client . Equipment . UpdateEntityPacket (); } break; } } break; } default: { if ( npcRequest . OptionID == 255 ) break; client . SelectedItem = ( byte )( npcRequest . OptionID % 10 ); client . UpdateType = ( byte )( npcRequest . OptionID / 10 ); if ( client . Equipment . Free ( client . SelectedItem )) { dialog . Text ( "You have to be wearing the selected item." ); dialog . Option ( "I'll just leave" , 255 ); dialog . Send (); return; } var item = client . Equipment . TryGetItem ( client . SelectedItem ); var itemdetail = Conquer_Online_Server . Database . ConquerItemInformation . BaseInformations [ item . ID ]; if ( itemdetail == null ) { dialog . Text ( "An error occured. Please relogin and try again." ); dialog . Option ( "Ok." , 255 ); dialog . Send (); return; } switch ( client . UpdateType ) { case 1 : case 2 : { if ( itemdetail . Level == Conquer_Online_Server . Network . PacketHandler . ItemMaxLevel ( client . SelectedItem ) && client . UpdateType == 1 ) { dialog . Text ( "This item's level cannot be upgraded anymore." ); dialog . Option ( "Ahh sorry." , 255 ); dialog . Send (); client . SelectedItem = 0 ; client . UpdateType = 0 ; return; } if ( itemdetail . Level == Conquer_Online_Server . Network . PacketHandler . ItemMinLevel ( client . SelectedItem ) && client . UpdateType == 2 ) { dialog . Text ( "This item's level cannot be downgraded anymore." ); dialog . Option ( "Ahh sorry." , 255 ); dialog . Send (); client . SelectedItem = 0 ; client . UpdateType = 0 ; return; } byte cost = ( byte )( itemdetail . Level / 5 ); cost += ( byte )(( item . ID % 10 ) / 3 ); cost += ( byte )( itemdetail . Level / 10 ); dialog . Text ( "It will cost you " + cost + " meteor" + ( client . UpdateType == 2 ? " tears" : "s" ) + ". Do you accept?" ); dialog . Option ( "Yes please." , 100 ); dialog . Option ( "No thanks." , 255 ); dialog . Send (); break; } case 3 : { if ( item . ID % 10 == 9 ) { dialog . Text ( "This item's quality cannot be upgraded anymore." ); dialog . Option ( "Ahh sorry." , 255 ); dialog . Send (); client . SelectedItem = 0 ; client . UpdateType = 0 ; return; } byte cost = ( byte )( itemdetail . Level / 30 ); cost += ( byte )(( item . ID % 10 ) / 2 ); dialog . Text ( "It will cost you " + cost + " dragonballs. Do you accept?" ); dialog . Option ( "Yes please." , 100 ); dialog . Option ( "No thanks." , 255 ); dialog . Send (); break; } } break; } } break; } #endregion
i hope to solve that problem(with your help) or at least learn something new
Similar Threads
any cheat engine for Attack, Magic Attack And Defense?
04/16/2012 - Cabal Online - 2 Replies
as the title it says..i'm looking for Attack, Magic Attack And Defense address in cheat engine for Cabal Online..TIA
Half Ass Magic Artisan?
06/23/2011 - CO2 PServer Guides & Releases - 1 Replies
This is the base code for Magic Atrisan. I did all the easy shit so serious coders can get right to work on the harder shit.
Btw, I'm not doing this to try and leech the finished code if it's released, it's just my way of contributing to a site that has filled so much of my spare time ^
#region MagicArtisan
case 10062:
{
switch (LinkBack)
{
case 0://NPC
...
[Help] Magic Artisan
07/17/2009 - CO2 Private Server - 1 Replies
Someone can help me on how to fix bug in Magic Artisan. Magic Artisan cant upgrade the Backsword and bracelet. Anyone can help me. thanks
Help Magic artisan
07/16/2009 - CO2 Private Server - 0 Replies
Anyone knows how to fix Magic Artisan NPC.. The bracelet and backsword cant be upgraded..
Upgrading Super Gear in TC Artisan
05/05/2008 - Conquer Online 2 - 13 Replies
OK, Ive heard that using Lucky time and upgrading your gears with Artisan in TC using mets may be successful, but what I dont know if its ALL gears. I mean, I have a super tro armor +5 lvl 110, can I upgrade it with mets and lucky time at Artisan in TC?? doesnt matter the quality and the + for upgrading it on TC with lucky time and mets?
Ohh, btw, I may socket it while trying to upgrade, right?
THANKS
All times are GMT +2. The time now is 09:21 .