Jump to content
  • 0

Need help whith code


Question

Posted

Index javacoml2jserverConfig.java
===================================================================
--- javacoml2jserverConfig.java    (revision 4410)
+++ javacoml2jserverConfig.java    (working copy)
@@ -676,6 +676,8 @@
     public static String L2JMOD_MULTILANG_DEFAULT;
     public static boolean L2JMOD_MULTILANG_VOICED_ALLOW;
     public static boolean L2WALKER_PROTECTION;
+    public static int STORE_BUY_CURRENCY;
+    public static int STORE_SELL_CURRENCY;

     --------------------------------------------------
      NPC Settings
@@ -2285,6 +2287,8 @@
                     L2JMOD_MULTILANG_VOICED_ALLOW = Boolean.parseBoolean(L2JModSettings.getProperty(MultiLangVoiceCommand, True));
                     
                     L2WALKER_PROTECTION = Boolean.parseBoolean(L2JModSettings.getProperty(L2WalkerProtection, False));
+                    STORE_BUY_CURRENCY = Integer.parseInt(L2JModSettings.getProperty(PrivateStoreBuyMoneda, 57));
+                    STORE_SELL_CURRENCY = Integer.parseInt(L2JModSettings.getProperty(PrivateStoreSellMoneda, 57));
                 }
                 catch (Exception e)
                 {
Index javacoml2jservergameservermodelTradeList.java
===================================================================
--- javacoml2jservergameservermodelTradeList.java    (revision 4410)
+++ javacoml2jservergameservermodelTradeList.java    (working copy)
@@ -802,9 +802,10 @@
                 slots++;
         }
         
-        if (totalPrice  playerInventory.getAdena())
+        if (totalPrice  player.getBuyStoreCurrency())
         {
-            player.sendPacket(new SystemMessage(SystemMessageId.YOU_NOT_ENOUGH_ADENA));
+            final String name = ItemTable.getInstance().getTemplate(Config.STORE_BUY_CURRENCY).getName();
+            player.sendMessage(You dont have enough +name);
             return 1;
         }
         
@@ -823,12 +824,12 @@
          Prepare inventory update packets
         final InventoryUpdate ownerIU = new InventoryUpdate();
         final InventoryUpdate playerIU = new InventoryUpdate();
-        
-        final L2ItemInstance adenaItem = playerInventory.getAdenaInstance();
-        playerInventory.reduceAdena(PrivateStore, totalPrice, player, _owner);
+        final int moneda = Config.STORE_BUY_CURRENCY;
+        final L2ItemInstance adenaItem = playerInventory.getItemByItemId(moneda);
+        player.destroyItemByItemId(PrivateStore, moneda, totalPrice, _owner, true);
         playerIU.addItem(adenaItem);
-        ownerInventory.addAdena(PrivateStore, totalPrice, _owner, player);
-        ownerIU.addItem(ownerInventory.getAdenaInstance());
+        ownerInventory.addItem(PrivateStore, moneda, totalPrice, _owner, player);
+        ownerIU.addItem(ownerInventory.getItemByItemId(moneda));
         
         boolean ok = true;
         
@@ -965,7 +966,7 @@
                 break;
             }
             
-            if (ownerInventory.getAdena()  _totalPrice)
+            if (_owner.getSellStoreCurrency()  _totalPrice)
                 continue;
             
              Check if requested item is available for manipulation
@@ -1043,11 +1044,12 @@
             if (totalPrice  ownerInventory.getAdena())
                  should not happens, just a precaution
                 return false;
-            final L2ItemInstance adenaItem = ownerInventory.getAdenaInstance();
-            ownerInventory.reduceAdena(PrivateStore, totalPrice, _owner, player);
+            final int moneda = Config.STORE_SELL_CURRENCY;
+            final L2ItemInstance adenaItem = ownerInventory.getItemByItemId(moneda);
+            ownerInventory.destroyItemByItemId(PrivateStore, moneda, totalPrice, _owner, player);
             ownerIU.addItem(adenaItem);
-            playerInventory.addAdena(PrivateStore, totalPrice, player, _owner);
-            playerIU.addItem(playerInventory.getAdenaInstance());
+            playerInventory.addItem(PrivateStore, moneda, totalPrice, player, _owner);
+            playerIU.addItem(playerInventory.getItemByItemId(moneda));
         }
         
         if (ok)
Index javacoml2jservergameservermodelactorinstanceL2PcInstance.java
===================================================================
--- javacoml2jservergameservermodelactorinstanceL2PcInstance.java    (revision 4410)
+++ javacoml2jservergameservermodelactorinstanceL2PcInstance.java    (working copy)
@@ -14889,4 +14889,18 @@
             addSkill(SkillTable.getInstance().getInfo(id, nextLevel), true);
         }
     }
+    
+    public synchronized long getBuyStoreCurrency()
+    {
+        L2ItemInstance item = this.getInventory().getItemByItemId(Config.STORE_BUY_CURRENCY);
+        
+        return item == null 0  item.getCount();
+    }
+    
+    public synchronized long getSellStoreCurrency()
+    {
+        L2ItemInstance item = this.getInventory().getItemByItemId(Config.STORE_SELL_CURRENCY);
+        
+        return item == null 0  item.getCount();
+    }
}
Index javacoml2jservergameservermodelitemcontainerPcInventory.java
===================================================================
--- javacoml2jservergameservermodelitemcontainerPcInventory.java    (revision 4410)
+++ javacoml2jservergameservermodelitemcontainerPcInventory.java    (working copy)
@@ -85,11 +85,14 @@
         FastListL2ItemInstance list = FastList.newInstance();
         for (L2ItemInstance item  _items)
         {
-            if ((!allowAdena && item.getItemId() == 57))
+            final int itemId = item.getItemId();
+            if ((!allowAdena && itemId == 57))
                 continue;
-            if ((!allowAncientAdena && item.getItemId() == 5575))
+            if ((!allowAncientAdena && itemId == 5575))
                 continue;
-
+            if(itemId == Config.STORE_BUY_CURRENCY)
+                continue;
+            
             boolean isDuplicate = false;
             for (L2ItemInstance litem  list)
             {
Index javacoml2jservergameservernetworkclientpacketsSetPrivateStoreListBuy.java
===================================================================
--- javacoml2jservergameservernetworkclientpacketsSetPrivateStoreListBuy.java    (revision 4410)
+++ javacoml2jservergameservernetworkclientpacketsSetPrivateStoreListBuy.java    (working copy)
@@ -140,7 +140,7 @@
         }
         
          Check for available funds
-        if (totalCost  player.getAdena())
+        if (totalCost  player.getBuyStoreCurrency())
         {
             player.sendPacket(new PrivateStoreManageListBuy(player));
             player.sendPacket(new SystemMessage(SystemMessageId.THE_PURCHASE_PRICE_IS_HIGHER_THAN_MONEY));
Index javacoml2jservergameservernetworkserverpacketsPrivateStoreListBuy.java
===================================================================
--- javacoml2jservergameservernetworkserverpacketsPrivateStoreListBuy.java    (revision 4410)
+++ javacoml2jservergameservernetworkserverpacketsPrivateStoreListBuy.java    (working copy)
@@ -33,7 +33,7 @@
     public PrivateStoreListBuy(L2PcInstance player, L2PcInstance storePlayer)
     {
         _objId = storePlayer.getObjectId();
-        _playerAdena = player.getAdena();
+        _playerAdena = player.getBuyStoreCurrency();
         storePlayer.getSellList().updateItems();  Update SellList for case inventory content has changed
         _items = storePlayer.getBuyList().getAvailableItems(player.getInventory());
     }
Index javacoml2jservergameservernetworkserverpacketsPrivateStoreListSell.java
===================================================================
--- javacoml2jservergameservernetworkserverpacketsPrivateStoreListSell.java    (revision 4410)
+++ javacoml2jservergameservernetworkserverpacketsPrivateStoreListSell.java    (working copy)
@@ -34,7 +34,7 @@
     public PrivateStoreListSell(L2PcInstance player, L2PcInstance storePlayer)
     {
         _objId = storePlayer.getObjectId();
-        _playerAdena = player.getAdena();
+        _playerAdena = player.getSellStoreCurrency();
         _items = storePlayer.getSellList().getItems();
         _packageSale = storePlayer.getSellList().isPackaged();
     }
Index javacoml2jservergameservernetworkserverpacketsPrivateStoreManageListBuy.java
===================================================================
--- javacoml2jservergameservernetworkserverpacketsPrivateStoreManageListBuy.java    (revision 4410)
+++ javacoml2jservergameservernetworkserverpacketsPrivateStoreManageListBuy.java    (working copy)
@@ -34,7 +34,7 @@
     public PrivateStoreManageListBuy(L2PcInstance player)
     {
         _objId = player.getObjectId();
-        _playerAdena = player.getAdena();
+        _playerAdena = player.getBuyStoreCurrency();
         _itemList = player.getInventory().getUniqueItems(false, true);
         _buyList = player.getBuyList().getItems();
     }
Index javacoml2jservergameservernetworkserverpacketsPrivateStoreManageListSell.java
===================================================================
--- javacoml2jservergameservernetworkserverpacketsPrivateStoreManageListSell.java    (revision 4410)
+++ javacoml2jservergameservernetworkserverpacketsPrivateStoreManageListSell.java    (working copy)
@@ -42,7 +42,7 @@
     public PrivateStoreManageListSell(L2PcInstance player, boolean isPackageSale)
     {
         _objId = player.getObjectId();
-        _playerAdena = player.getAdena();
+        _playerAdena = player.getSellStoreCurrency();
         player.getSellList().updateItems();
         _packageSale = isPackageSale;
         _itemList = player.getInventory().getAvailableItems(player.getSellList());
Index javaconfigl2jmods.properties
===================================================================
--- javaconfigl2jmods.properties    (revision 4410)
+++ javaconfigl2jmods.properties    (working copy)
@@ -379,3 +379,14 @@
# Basic protection against L2Walker.
# Default False
L2WalkerProtection = False
+
+# ---------------------------------------------------------------------------
+# Private Store BuySell - Moneda de cambio
+# ---------------------------------------------------------------------------
+# Elige que moneda quieres que se use como pago en los Private Store Buy (amarillos)
+# Retail 57, Por Defecto 57
+PrivateStoreBuyMoneda = 57
+
+# Elige que moneda quieres que se use como pago en los Private Store Sell (morados)
+# Retail 57, Por Defecto 57
+PrivateStoreSellMoneda = 57

 

were i hawe to add this? into general.properties? and i hawe to add all tihis code o just this

+# ---------------------------------------------------------------------------
+# Private Store BuySell - Moneda de cambio
+# ---------------------------------------------------------------------------
+# Elige que moneda quieres que se use como pago en los Private Store Buy (amarillos)
+# Retail 57, Por Defecto 57
+PrivateStoreBuyMoneda = 57
+
+# Elige que moneda quieres que se use como pago en los Private Store Sell (morados)
+# Retail 57, Por Defecto 57
+PrivateStoreSellMoneda = 57

8 answers to this question

Recommended Posts

  • 0
Posted

please help! and sorry for bad english

 

 

Read sticked guides and FAQ's, everything is EXPLAINED.

  • 0
Posted

i can't find any guides so i asking in here !

 

You "can't find" or you're to lazy to search them?

 

Take a look at sticked guides on the top of This Section.

  • 0
Posted

why dont you ask for help where you found the code?

i posted few weeks ago in the spanish community from where you took it, so ask there

and first, learn to apply patches, you did erase all the file routes

Guest
This topic is now closed to further replies.


  • Posts

    • Does anyone have/can share OOG bot for Interlude? Can't believe that there are no working copies exist 😉
    • Well...i dont wanna flame him or defame him ,2 months after the order and he havent delivered and tbh this isnt my issue...he just stopped responding,he didnt scammed me or anything like this..Just ghosting 😄
    • I cant respond for personal issues that anybody can face in real life.  About Nevesoma, for sure he gonna deliver you, just realize how many clients and orders he has. Please be patient, things need time. Sincerely.
    • Yeah…i will need other alternatives   Neves0ma i hired him to do a job and never delivered and keeps ghosting me Ave dont respond to me,i hired him and then canceled order and since then we cant work together 
    • The Dawn of Book in the NPC's hand isn't showing up. Is there a way to fix this?   This NPC is probably the only one in the game who wields a weapon with his left hand.   Weapon :[dawnn_book]    =    5802   I've tried several server-side programs, including Java emulators, and they all seem to have this problem. Or is there some special game mechanic controlling this NPC?   npc_begin teleporter 31081 [dawn_priest_giran] category={} level=70 exp=429634523 ex_crt_effect=1 unique=0 s_npc_prop_hp_rate=1 race=human sex=male skill_list={@s_npc_prop_race_human;@s_npc_prop_hp_lv_p0;@s_npc_prop_mp_lv_p0;@s_npc_prop_pa_lv_p0;@s_npc_prop_ma_lv_p0;@s_npc_prop_pd_lv_p0;@s_npc_prop_md_lv_p0;@s_npc_prop_armor_type_n;@s_npc_prop_weapon_type_fist;@s_full_magic_defence} slot_chest=[] slot_rhand=[] slot_lhand=[dawnn_book] collision_radius={8;8} collision_height={30.5;30.5} hit_time_factor=0.6 hit_time_factor_skill=-1 ground_high={120;0;0} ground_low={50;0;0} str=40 int=21 dex=30 wit=20 con=43 men=20 org_hp=2444.46819 org_hp_regen=7.5 org_mp=1345.8 org_mp_regen=2.7 base_attack_type=fist base_attack_range=40 base_damage_range={0;0;80;120} base_rand_dam=10 base_physical_attack=688.86373 base_critical=4 physical_hit_modify=5 base_attack_speed=253 base_reuse_delay=0 base_magic_attack=470.40463 base_defend=295.91597 base_magic_defend=216.53847 base_attribute_attack={none;0} base_attribute_defend={150;150;150;150;150;150;150} physical_avoid_modify=0 shield_defense_rate=20 shield_defense=147.957985 safe_height=100 soulshot_count=0 spiritshot_count=0 clan={} ignore_clan_list={} clan_help_range=300 undying=1 can_be_attacked=0 corpse_time=7 no_sleep_mode=0 agro_range=1000 passable_door=0 can_move=1 flying=0 has_summoner=0 targetable=1 show_name_tag=1 npc_ai={[dawn_priest_giran];{[MoveAroundSocial]=0};{[MoveAroundSocial1]=110};{[ssq_priest_type]=2}} event_flag={0} unsowing=1 private_respawn_log=0 acquire_exp_rate=0 acquire_sp=0 acquire_rp=0 corpse_make_list={} additional_make_list={} additional_make_multi_list={} ex_item_drop_list={} fake_class_id=-1 npc_end  
  • Topics

×
×
  • Create New...

AdBlock Extension Detected!

Our website is made possible by displaying online advertisements to our members.

Please disable AdBlock browser extension first, to be able to use our community.

I've Disabled AdBlock