Quantcast
Channel: RaGEZONE - MMO Development Forums
Viewing all 29686 articles
Browse latest View live

sửa MH HTC HD2 giá tốt

$
0
0
Thay man hinh htc Sensation XE

Các bạn đang muốn tìm dịch vụ sửa chữa mặt kính htc Sensation XE, thay màn hình htc G13, sửa cảm ứng htc Sensation XE chuyên nghiệp, uy tín? SkMobile - Trung tâm Bảo hành Sửa chữa chính là trung tâm sửa chữa Điện thoại thông minh có uy tín lâu năm tại Hà Nội. Với hàng ngũ kỹ thuật giỏi chuyên môn và nguồn linh kiện màn hình htc G13 nhập khẩu chính hãng, trung tâm SkMobile tự tin về chất lượng dịch vụ của mình chắc rằng sẽ làm hài lòng khách hàng.
Thay Màn hình HTC HD2
Vì sao nên lựa chọn dịch vụ của trung tâm Skmobile?
❶ Linh kiện sửa chính hãng 100%.
❷ Trang thiết bị nhập khẩu từ Nhật Bản.
❸ Giá cả phù hợp hàng đầu thị trường.
❹ Hàng ngũ kỹ thuật viên tận tâm, chu đáo số 1.
❺ Thời gian Bảo hành dài lâu, chu đáo.
❻ Nhiều chương trình bảo hành và hỗ trợ quý khách sau sửa.
❼ Và còn nhiều hơn nữa chỉ có tại Trung tâm Bảo hành Sửa chữa SkMobile.
Thay man hinh htc G13
Hãy đến với SkMobile để cảm nhận chất lượng dịch vụ tốt nhất!
★ Địa chỉ: Số 130 đường Thái Hà - Đống Đa - Thành phố Hà Nội
★ Hotline: 0123.83.66666 - 0938.269.866

[Help] SQL (spInsertChar)

$
0
0
Hello friends as you can see I'm working on part of creating character and want to change weapons & Clothing
when one character is created, the problem is to place the jquery to DB, and test the
customer and nothing changed the code fails to see that you say quue ando
I doing wrong .. I hope answers thanks ^^

PHP Code:

USE [GunzDB]
GO
/****** Object:  StoredProcedure [dbo].[spInsertChar]    Script Date: 10/17/2010 23:47:21 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

/* ??? ?? */
ALTER PROC [dbo].[spInsertChar]
    [
MENTION=420555]Aid[/MENTION]        int,
    [
MENTION=551894]Char[/MENTION]Num    smallint,
    [
MENTION=1333344765]name[/MENTION]        varchar(24),
    [
MENTION=2000001935]Sex[/MENTION]        tinyint,
    [
MENTION=2000204264]Hair[/MENTION]        int,  
    [
MENTION=12229]face[/MENTION]        int,
    @
Costume    int
AS
SET NOCOUNT ON
BEGIN TRAN
IF EXISTS (SELECT CID FROM Character where (AID [MENTION=420555]Aid[/MENTION] AND CharNum [MENTION=551894]Char[/MENTION]Num) OR (Name [MENTION=1333344765]name[/MENTION]))
BEGIN    
    ROLLBACK TRAN
    
return(-1)
END

DECLARE [MENTION=551894]Char[/MENTION]Ident     int
DECLARE [MENTION=2000063737]Che[/MENTION]stCIID    int
DECLARE [MENTION=799313]Leg[/MENTION]sCIID    int
DECLARE [MENTION=1333417480]Head[/MENTION]CIID    int
DECLARE [MENTION=265699]Fee[/MENTION]tCIID    int
DECLARE [MENTION=277254]haNd[/MENTION]sCIID    int
DECLARE [MENTION=780187]Mele[/MENTION]eCIID    int
DECLARE [MENTION=1333387706]Primary[/MENTION]CIID    int
DECLARE [MENTION=1333477173]secondary[/MENTION]CIID  int
DECLARE [MENTION=25895]Custom[/MENTION]1CIID    int
DECLARE [MENTION=25895]Custom[/MENTION]2CIID    int

DECLARE [MENTION=2000063737]Che[/MENTION]stItemID    int
DECLARE [MENTION=799313]Leg[/MENTION]sItemID    int
DECLARE [MENTION=1333417480]Head[/MENTION]ItemID     int
DECLARE [MENTION=265699]Fee[/MENTION]tItemID    int
DECLARE [MENTION=277254]haNd[/MENTION]sItemID    int
DECLARE [MENTION=780187]Mele[/MENTION]eItemID    int
DECLARE [MENTION=1333387706]Primary[/MENTION]ItemID    int
DECLARE [MENTION=1333477173]secondary[/MENTION]ItemID  int
DECLARE [MENTION=25895]Custom[/MENTION]1ItemID    int
DECLARE [MENTION=25895]Custom[/MENTION]2ItemID    int

SET 
[MENTION=1333477173]secondary[/MENTION]CIID NULL
SET 
[MENTION=1333477173]secondary[/MENTION]ItemID NULL

SET 
[MENTION=25895]Custom[/MENTION]1CIID NULL
SET 
[MENTION=25895]Custom[/MENTION]1ItemID NULL

SET 
[MENTION=25895]Custom[/MENTION]2CIID NULL
SET 
[MENTION=25895]Custom[/MENTION]2ItemID NULL

INSERT INTO Character 
(AIDNameCharNumLevelSexHairFaceXPBPFRCRERWR
                            
GameCountKillCountDeathCountRegDatePlayTimeDeleteFlag)
Values  [MENTION=420555]Aid[/MENTION], [MENTION=1333344765]name[/MENTION], [MENTION=551894]Char[/MENTION]Num1, [MENTION=2000001935]Sex[/MENTION], [MENTION=2000204264]Hair[/MENTION], [MENTION=12229]face[/MENTION], 000000000GETDATE(), 00)
IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
END


SET 
[MENTION=551894]Char[/MENTION]Ident = @@IDENTITY

  
/* Melee */
  
SET [MENTION=780187]Mele[/MENTION]eItemID 
    CASE @
Costume
    WHEN 0 THEN 2
    WHEN 1 THEN 2
    WHEN 2 THEN 2
    WHEN 3 THEN 2
    WHEN 4 THEN 2
    WHEN 5 THEN 2
    END

  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=780187]Mele[/MENTION]eItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=780187]Mele[/MENTION]eCIID = @@IDENTITY

  
/* Primary */
  
SET [MENTION=1333387706]Primary[/MENTION]ItemID 
    CASE @
Costume
    WHEN 0 THEN 6002
    WHEN 1 THEN 6002
    WHEN 2 THEN 6002
    WHEN 3 THEN 6002
    WHEN 4 THEN 6002
    WHEN 5 THEN 6002
    END

  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=1333387706]Primary[/MENTION]ItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=1333387706]Primary[/MENTION]CIID = @@IDENTITY

  
/* Secondary */
  
IF @Costume OR @Costume 2 BEGIN 
  SET 
[MENTION=1333477173]secondary[/MENTION]ItemID =
    CASE @
Costume
    WHEN 0 THEN 6001
    WHEN 1 THEN 6001
    WHEN 2 THEN 6001
    WHEN 3 THEN 6001
    WHEN 4 THEN 6001
    WHEN 5 THEN 6001
    END

  
IF [MENTION=1333477173]secondary[/MENTION]ItemID <> 0 BEGIN
    INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=1333477173]secondary[/MENTION]ItemID)
    IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
    
END

    SET 
[MENTION=1333477173]secondary[/MENTION]CIID = @@IDENTITY
  END
  END 
  SET 
[MENTION=25895]Custom[/MENTION]1ItemID 
    CASE @
Costume
    WHEN 0 THEN 30001
    WHEN 1 THEN 30001
    WHEN 2 THEN 30001
    WHEN 3 THEN 30001
    WHEN 4 THEN 30001
    WHEN 5 THEN 30001
    END

  
/* Custom1 */
  
INSERT INTO CharacterItem (CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=25895]Custom[/MENTION]1ItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=25895]Custom[/MENTION]1CIID = @@IDENTITY

  
/* Custom2 */
  
IF @Costume OR @9Costume 5
BEGIN
  SET 
[MENTION=25895]Custom[/MENTION]2ItemID =
    CASE @
Costume
    WHEN 0 THEN 30101
    WHEN 1 THEN 30101
    WHEN 2 THEN 30101
    WHEN 3 THEN 30101
    WHEN 4 THEN 30101
    WHEN 5 THEN 30101
    END

  
IF [MENTION=25895]Custom[/MENTION]2ItemID <> 0
  BEGIN
    INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=25895]Custom[/MENTION]2ItemID)
    IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
    
END

    SET 
[MENTION=25895]Custom[/MENTION]2CIID = @@IDENTITY
  END
END


IF [MENTION=2000001935]Sex[/MENTION] = 0        /* Male */
BEGIN

  
/* Head */
  
SET [MENTION=1333417480]Head[/MENTION]ItemID =
    CASE @
Costume
    WHEN 0 THEN 520047
    WHEN 1 THEN 520039
    WHEN 2 THEN 520009
    WHEN 3 THEN 520010
    WHEN 4 THEN 520014
    WHEN 5 THEN 520020
    END

  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=1333417480]Head[/MENTION]ItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=1333417480]Head[/MENTION]CIID = @@IDENTITY

  
/* Chest */
  
SET [MENTION=2000063737]Che[/MENTION]stItemID =
    CASE @
Costume
    WHEN 0 THEN 521038
    WHEN 1 THEN 521031
    WHEN 2 THEN 21501
    WHEN 3 THEN 521006
    WHEN 4 THEN 521009
    WHEN 5 THEN 521016
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=2000063737]Che[/MENTION]stItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=2000063737]Che[/MENTION]stCIID = @@IDENTITY

  
/* Legs */
  
SET [MENTION=799313]Leg[/MENTION]sItemID =
    CASE @
Costume
    WHEN 0 THEN 523033
    WHEN 1 THEN 523029
    WHEN 2 THEN 523002
    WHEN 3 THEN 523006
    WHEN 4 THEN 523009
    WHEN 5 THEN 523015
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=799313]Leg[/MENTION]sItemID)
  IF 
<> @@ERROR BEGIN 
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=799313]Leg[/MENTION]sCIID = @@IDENTITY

  
/* Hands */
  
SET [MENTION=277254]haNd[/MENTION]sItemID =
    CASE @
Costume
    WHEN 0 THEN 522030
    WHEN 1 THEN 522026
    WHEN 2 THEN 22004
    WHEN 3 THEN 522006
    WHEN 4 THEN 522009
    WHEN 5 THEN 522015
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=277254]haNd[/MENTION]sItemID)
  IF 
<> @@ERROR BEGIN 
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=277254]haNd[/MENTION]sCIID = @@IDENTITY

  
/* Feet */
  
SET [MENTION=265699]Fee[/MENTION]tItemID =
    CASE @
Costume
    WHEN 0 THEN 524033
    WHEN 1 THEN 524029
    WHEN 2 THEN 524002
    WHEN 3 THEN 524006
    WHEN 4 THEN 524009
    WHEN 5 THEN 524015
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=265699]Fee[/MENTION]tItemID)
  IF 
<> @@ERROR BEGIN 
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=265699]Fee[/MENTION]tCIID = @@IDENTITY

END
ELSE
BEGIN            /* Female */

  /* Head */
  
SET [MENTION=1333417480]Head[/MENTION]ItemID =
    CASE @
Costume
    WHEN 0 THEN 96
    WHEN 1 THEN 97
    WHEN 2 THEN 113
    WHEN 3 THEN 121
    WHEN 4 THEN 135
    WHEN 5 THEN 136
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=1333417480]Head[/MENTION]ItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END

  SET 
[MENTION=1333417480]Head[/MENTION]CIID = @@IDENTITY

  
/* Chest */
  
SET [MENTION=2000063737]Che[/MENTION]stItemID =
    CASE @
Costume
    WHEN 0 THEN 232
    WHEN 1 THEN 233
    WHEN 2 THEN 241
    WHEN 3 THEN 261
    WHEN 4 THEN 276
    WHEN 5 THEN 277
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=2000063737]Che[/MENTION]stItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END
  SET 
[MENTION=2000063737]Che[/MENTION]stCIID = @@IDENTITY

  
/* Legs */
  
SET [MENTION=799313]Leg[/MENTION]sItemID =
    CASE @
Costume
    WHEN 0 THEN 469
    WHEN 1 THEN 470
    WHEN 2 THEN 479
    WHEN 3 THEN 497
    WHEN 4 THEN 510
    WHEN 5 THEN 511
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=799313]Leg[/MENTION]sItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END
  SET 
[MENTION=799313]Leg[/MENTION]sCIID = @@IDENTITY

  
/* Feet */
  
SET [MENTION=265699]Fee[/MENTION]tItemID =
    CASE @
Costume
    WHEN 0 THEN 584
    WHEN 1 THEN 585
    WHEN 2 THEN 590
    WHEN 3 THEN 620
    WHEN 4 THEN 624
    WHEN 5 THEN 625
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=265699]Fee[/MENTION]tItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END
  SET 
[MENTION=265699]Fee[/MENTION]tCIID = @@IDENTITY

  
/* Hands */
  
SET [MENTION=277254]haNd[/MENTION]sItemID =
    CASE @
Costume
    WHEN 0 THEN 346
    WHEN 1 THEN 347
    WHEN 2 THEN 370
    WHEN 3 THEN 383
    WHEN 4 THEN 388
    WHEN 5 THEN 389
    END


  INSERT INTO CharacterItem 
(CIDItemIDValues  [MENTION=551894]Char[/MENTION]Ident, [MENTION=277254]haNd[/MENTION]sItemID)
  IF 
<> @@ERROR BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
  
END
  SET 
[MENTION=277254]haNd[/MENTION]sCIID = @@IDENTITY

END

UPDATE Character
SET head_slot 
= [MENTION=1333417480]Head[/MENTION]CIID,  feet_slot = [MENTION=265699]Fee[/MENTION]tCIIDhands_slot = [MENTION=277254]haNd[/MENTION]sCIIDchest_slot = [MENTION=2000063737]Che[/MENTION]stCIIDlegs_slot = [MENTION=799313]Leg[/MENTION]sCIIDmelee_slot = [MENTION=780187]Mele[/MENTION]eCIID,
    
primary_slot = [MENTION=1333387706]Primary[/MENTION]CIIDsecondary_slot = [MENTION=1333477173]secondary[/MENTION]CIIDcustom1_slot = [MENTION=25895]Custom[/MENTION]1CIID,
    
custom2_slot = [MENTION=25895]Custom[/MENTION]2CIID,
    
head_itemid = [MENTION=1333417480]Head[/MENTION]ItemIDchest_itemid = [MENTION=2000063737]Che[/MENTION]stItemIDlegs_itemid = [MENTION=799313]Leg[/MENTION]sItemIDfeet_itemid = [MENTION=265699]Fee[/MENTION]tItemIDhands_itemid = [MENTION=277254]haNd[/MENTION]sItemIDmelee_itemid = [MENTION=780187]Mele[/MENTION]eItemID,
    
primary_itemid = [MENTION=1333387706]Primary[/MENTION]ItemIDsecondary_itemid = [MENTION=1333477173]secondary[/MENTION]ItemIDcustom1_itemid = [MENTION=25895]Custom[/MENTION]1ItemID,
    
custom2_itemid = [MENTION=25895]Custom[/MENTION]2ItemID
WHERE CID 
[MENTION=551894]Char[/MENTION]Ident
IF = @@ROWCOUNT BEGIN
    ROLLBACK TRAN
    
RETURN (-1)
END
COMMIT TRAN 

[Help] Using two vps's to host a hotel?

$
0
0
Hi,
I want to get another vps for my hotel so i can have the emulator on it's own server
Now, how would i go on about doing this?
This is what i was going to do:

Just move the emulator over, keep everything the same (ips, etc) and allow the other ip on my mysql?

Would that work, would it connect & let others connect?

If not, Please tell me how i could do this.

Thanks.

[Request]Drop All Item Opt

$
0
0
Hello coders of Rz, I'm getting a little confused to make a Option to Drop all items at Inventory backpack in HUDPause.cpp and i was thinking if someone can give me a hands up with the code to select all the stack items to dropped

Now I can drop all the items with this function but when i pick up from the floor again this stack item doesn't update in the backpack inventory so the item goes to the Global Inventory any way to update in the backpack?
Code:

if(CurLoadout.Items[slotFrom].quantity = 100)
        {
                CurLoadout.Items[slotFrom].Reset();
        }

Code:


        int itemID = CurLoadout.Items[slotFrom].itemID;

        float DropitemDistance = 1.0f;

        PKT_C2S_BackpackDrop_s n;
        n.SlotFrom = slotFrom;
        n.pos      = GetPosition() + GetvForw()*DropitemDistance;
        p2pSendToHost(this, &n, sizeof(n));

        //local logic
        CurLoadout.Items[slotFrom].quantity--;
        if(CurLoadout.Items[slotFrom].quantity <= 0)
        {
                CurLoadout.Items[slotFrom].Reset();
        }

        const WeaponAttachmentConfig* wac = g_pWeaponArmory->getAttachmentConfig(itemID);
        if(wac)
        {
                int quantity = CurLoadout.Items[slotFrom].quantity; // if attm is droppen, then here will be zero
                for(int i=0; i<CurLoadout.BackpackSize; ++i)
                {
                        if(CurLoadout.Items[i].itemID == itemID)
                                quantity += CurLoadout.Items[i].quantity;
                }
                if(quantity == 0) // check if that attm is equipped and if yes, remove it from weapon
                {
                        uint32_t curAttm[WPN_ATTM_MAX] = {0};
                        if(m_Weapons[0])
                        {
                                m_Weapons[0]->getCurrentAttachmentIDs(curAttm);
                                if(curAttm[wac->m_type] == itemID)
                                        RemoveWpnAttm(0, wac->m_type);
                        }
                        if(m_Weapons[1])
                        {
                                m_Weapons[1]->getCurrentAttachmentIDs(curAttm);
                                if(curAttm[wac->m_type] == itemID)
                                        RemoveWpnAttm(1, wac->m_type);
                        }                       
                }
        }

        OnBackpackChanged(slotFrom);

        if(NetworkLocal)
        {
                const WeaponConfig* wc = g_pWeaponArmory->getWeaponConfig(itemID);
                if(wc)
                SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/WarZ/PlayerSounds/PLAYER_DROPGUN"), GetPosition());
                else
                        SoundSys.PlayAndForget(SoundSys.GetEventIDByPath("Sounds/WarZ/PlayerSounds/PLAYER_DROPITEM"), GetPosition());
        }

I have no idea atm where I can extract this code from another function
Attached Images

[Help] Does this Fishing work for moople too?

$
0
0
http://forum.ragezone.com/f427/auto-fishing-983631/

Quote:

Originally Posted by ljw5992 View Post
MapleCharacter.java
PHP Code:

    private transient ScheduledFuture<?fishTimer;
    private 
int fishTasking 0;
    private final 
int bait 4000166;
    public final 
int fishingMap 123456789;
    public final 
int fishingChair 3010018;

    public final 
void fishingTimer(int time) {
        
getClient().getSession().write(MaplePacketCreator.sendHint("Start Fishing...\r\n□□□□□□□□□□"200200));
        
fishTimer MapTimer.getInstance().register(new Runnable() {
            public 
void run() {
                if (
fishTasking 10) {
                    
fishTasking++;
                    
String gage "";
                    for (
int i 0<= fishTaskingi++) {
                        
gage += "■";
                    }
                    for (
int i 9fishTaskingi--) {
                        
gage += "□";
                    }
                    
getClient().getSession().write(MaplePacketCreator.sendHint("Fishing...\r\n" gage200200));
                } else {
                    
fishTasking 0;
                    if (
getItemQuantity(baitfalse) == 0) {
                        
cancelFishing();
                        return;
                    }
                    
int[][] items = {{399474520}, {399474220}};

                    
int chance = (int) Math.random() * 100;
                    
int count 0;
                    for (
int[] item items) {
                        if (
item[1] >= chance) {
                            
count++;
                        }
                    }
                    
int[] goods = new int[count];
                    
count 0;
                    for (
int[] item items) {
                        if (
item[1] >= chance) {
                            
goods[count] = item[0];
                            
count++;
                        }
                    }
                    
int chance2 = (int) Math.random() * goods.length;
                    if (
goods.length == 0) {
                        
getClient().getSession().write(MaplePacketCreator.sendHint("Fail"200200));
                    } else {
                        if (
getInventory(GameConstants.getInventoryType(goods[chance2])).getNextFreeSlot() > -1) {
                            
getClient().getSession().write(MaplePacketCreator.sendHint("Check your inventory"200200));
                        } else {
                            
MapleInventoryManipulator.addById(getClient(), goods[chance2], (short1null);
                            
getClient().getSession().write(MaplePacketCreator.sendHint("You got #b" MapleItemInformationProvider.getInstance().getItemInformation(goods[chance2]).name "#k"200200));
                        }
                    }
                    
MapleInventoryManipulator.addById(getClient(), bait, (short) -1null);
                }
            }
        }, 
time 10time 10);
    }


    public final 
void cancelFishing() {
        if (
fishTimer != null) {
            if (
getItemQuantity(baitfalse) == 0) {
                
getClient().getSession().write(MaplePacketCreator.sendHint("You need more bait"200200));
            } else {
                
getClient().getSession().write(MaplePacketCreator.sendHint("Stop Fishing"200200));
            }
            
fishTimer.cancel(false);
            
fishTimer null;
        }
    }

PlayerHandler.java
PHP Code:

    public static final void UseChair(final int itemId, final MapleClient c, final MapleCharacter chr) {
        if (
chr == null || chr.getMap() == null) {
            return;
        }
        final 
Item toUse chr.getInventory(MapleInventoryType.SETUP).findById(itemId);
        if (
toUse == null) {
            
chr.getCheatTracker().registerOffense(CheatingOffense.USING_UNAVAILABLE_ITEMInteger.toString(itemId));
            return;
        }
        
//add
        
if (itemId == chr.fishingChair && chr.getMapId() == chr.fishingMap) {
            
chr.fishingTimer(15000);
        }

        
chr.setChair(itemId);
        
chr.getMap().broadcastMessage(chrMaplePacketCreator.showChair(chr.getId(), itemId), false);
        
c.getSession().write(MaplePacketCreator.enableActions());
    }

    public static final 
void CancelChair(final short id, final MapleClient c, final MapleCharacter chr) {

//add
        
if(chr.getMapId() == chr.fishingMap){
            
chr.cancelFishing();
    }

        if (
id == -1) { // Cancel Chair
            
chr.setChair(0);
            
c.getSession().write(MaplePacketCreator.cancelChair(-1));
            if (
chr.getMap() != null) {
                
chr.getMap().broadcastMessage(chrMaplePacketCreator.showChair(chr.getId(), 0), false);
            }
        } else { 
// Use In-Map Chair
            
chr.setChair(id);
            
c.getSession().write(MaplePacketCreator.cancelChair(id));
        }
    } 


[help]How to check the backpack with or without specified items

$
0
0
If there are specific items into the game.
If no items prohibited from entering the game.
Code:

        for (int a = 0; a < slot.BackpackSize; a++)
        {
                if(channel == 6 && slot.Items[a].itemID != 100999)
                {
                Scaleform::GFx::Value var[2];
                var[0].SetString(gLangMngr.getString("NotAllowedPlayers"));
                var[1].SetBoolean(true);
                gfxMovie.Invoke("_root.api.showInfoMsg", var, 2);
                return;
            }
        }

[Help] Offset for Rena Price or Heart Price?

$
0
0
I'm trying to find this offsets, I'm using IA Julia S4.6,
either Rena's price or Heart's price (Heart, not Heart of Love).
Does anyone know any of this offsets? :)

Java Overhauled Command Logic

$
0
0
I was inspired by a recent thread to release my command system. This code is more than 4 years old, so it's not the greatest, but I also cleaned it up a little bit. It is fairly similar to Lithium's, but I think it's simpler and more flexible, though I don't remember too much about it. I just know they both use reflection at the core.

The Code:

client.commands.GMLevel:
PHP Code:

package client.commands;

public 
enum GMLevel {
    
PLAYER('@'),
    
DONOR('!'),
    
INTERN('!'),
    
GM('!'),
    
ADMIN('!');
    
char commandChar;

    
GMLevel(char commandChar) {
        
this.commandChar commandChar;
    }

    public static 
GMLevel getByLevel(int level) {
        return 
values()[level];
    }

    public static 
boolean isCommandChar(char a) {
        for (
GMLevel g values()) {
            if (
g.getCommandChar() == a) {
                return 
true;
            }
        }
        return 
false;
    }

    public 
int getValue() {
        return 
ordinal();
    }

    public 
char getCommandChar() {
        return 
commandChar;
    }


GMLevel is used universally throughout the source; all Characters should have one. Adapt your current GMLevel-equivalent or replace with this one, as this is the one I will use in the rest of the command system. It's pretty standard in implementation.

client.commands.CommandProcessor:
PHP Code:

package client.commands;

import client.MapleCharacter;
import client.MapleClient;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.extern.slf4j.Slf4j;


import java.lang.reflect.Modifier;
import java.text.SimpleDateFormat;
import java.util.*;

@Slf4j
public class CommandProcessor {
    protected static Map<GMLevel, Map<String, Command>> commands = new EnumMap<>(GMLevel.class);

    public static void load() {
        for (GMLevel gmLevel : GMLevel.values()) {
            commands.put(gmLevel, new LinkedHashMap<>());
        }
        Class<?>[] commandClasses = {AdminCommands.class, GMCommands.class, InternCommands.class, DonorCommands.class, PlayerCommands.class};
        for (Class<
?> abstractCommand : commandClasses) {
            for (Class<?command abstractCommand.getClasses()) {
                if (!
Modifier.isAbstract(command.getModifiers())) {
                    try {
                        
Command cm = (Commandcommand.newInstance();
                        
commands.get(cm.getReqGMLevel()).put(cm.getName().toLowerCase(), cm);
                    } catch (
Exception e) {
                        
log.error("Error creating command " command " by reflection"e);
                    }
                }
            }
        }
    }

    public 
enum ProcessCommandResponse {
        
ERR_NO_COMMAND_CHAR,
        
ERR_NOT_A_COMMAND,
        
ERR_INSUFFICIENT_PRIVILEGES,
        
SUCCESS
    
}

    public static 
ProcessCommandResponse processCommand(MapleClient cString text) {
        
char commandChar text.charAt(0);
        if (!
GMLevel.isCommandChar(commandChar)) {
            return 
ProcessCommandResponse.ERR_NO_COMMAND_CHAR;
        }
        
String splitted[] = text.substring(1).split(" ");
        
GMLevel[] values GMLevel.values();
        
MapleCharacter chr c.getCharacter(); // this is important; it keeps a reference to the chr during cc commands
        
Command cm null;
        
boolean isCommandCharAllowed false;
        
// check for a valid command
        
for (int i chr.getGMLevel(); >= GMLevel.PLAYER.getValue(); i--) {
            if (
values[i].getCommandChar() == commandChar) {
                
isCommandCharAllowed true;
                
Command cmd commands.get(values[i]).get(splitted[0].toLowerCase());
                if (
cmd != null) {
                    
cm cmd;
                    break;
                }
            }
        }
        if (
cm == null) {
            
// if they have a high enough GMLevel to use the commandChar, send NOT_A_COMMAND
            // else, they have insufficient privileges, e.g. player (who can only use '@') used '!'
            
if (isCommandCharAllowed) {
                return 
ProcessCommandResponse.ERR_NOT_A_COMMAND;
            }
            return 
ProcessCommandResponse.ERR_INSUFFICIENT_PRIVILEGES;
        }
        
// remove the command name so the only strings passed to the command are the arguments, if any
        
String[] args = new String[splitted.length 1];
        
System.arraycopy(splitted1args0splitted.length 1);
        try {
            
cm.run(cargs);
        } catch (
Exception e) {
            
chr.dropMessage("Error! Please check your syntax, or wait for the command to be fixed.");
            
log.error("Exception in command: " commandChar cm.getName(), e);
        }

        if (
cm.getReqGMLevel().getValue() >= GMLevel.GM.getValue()) {
            
SimpleDateFormat logFormatter = new SimpleDateFormat("yyyyMMddHHmmss");
            
GMCommandLog cmdLog = new GMCommandLog(textchr.getMapId(), logFormatter.format(Calendar.getInstance().getTime()));
            
chr.addGMLog(cmdLog);
        }
        return 
ProcessCommandResponse.SUCCESS;
    }

    [
MENTION=1333435839]Allar[/MENTION]gsConstructor
    
[MENTION=2000147484]Get[/MENTION]ter
    
public static class GMCommandLog {
        private final 
String commandText;
        private final 
int mapId;
        private final 
String timestamp;
    }
}

Remove the lombok annotations and adapt the GM command logging if your source has one.

Then call this on server startup:
PHP Code:

CommandProcessor.load(); 


client.commands.Command:
PHP Code:

package client.commands;

import client.MapleClient;

public interface 
Command {
    
GMLevel getReqGMLevel();
    
String getName();
    
String getDesc();
    
void run(MapleClient cString[] commandArgs);


Main interface of the system. All commands will have a required GM level to use, a name, and a run method. The description is optional, but is used to auto-populate the help command for each GMLevel.


Now we can actually define commands. Let's start with the intern one, because it's an empty file. I never had interns, but I do have one now...

PHP Code:

package client.commands;

public abstract class 
InternCommands implements Command {

    public 
GMLevel getReqGMLevel() {
        return 
GMLevel.INTERN;
    }

    public 
String getDesc() {
        return 
"";
    }


Okay, so that's what the "root" abstract command classes will look like. They define an empty description and a GM level, which is inherited by all subclasses. The subclasses will be the actual commands. Let's take player commands, populated with some commands, as an example.

PHP Code:

package client.commands;
import client.MapleCharacter;
import client.MapleClient;
import scripting.npc.NPCScriptManager;
import scripting.quest.QuestScriptManager;
import tools.StringUtil;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public abstract class 
PlayerCommands implements Command {

    public 
GMLevel getReqGMLevel() {
        return 
GMLevel.PLAYER;
    }

    public 
String getDesc() {
        return 
"";
    }

    public static class 
EnableActions extends PlayerCommands {
        public 
String getName() {
            return 
"dispose";
        }

        public 
void run(MapleClient cString[] args) {
            
c.enableActions();
            
NPCScriptManager.getInstance().dispose(c);
            
QuestScriptManager.getInstance().dispose(c);
            
c.getCharacter().dropMessage("Disposed.");
        }
    }

    public static class 
OpenCody extends PlayerCommands {
        public 
String getName() {
            return 
"cody";
        }

        public 
String getDesc() {
            return 
"Opens Cody";
        }

        public 
void run(MapleClient cString[] args) {
            
NPCScriptManager.getInstance().start(c9200000);
        }
    }



Note that each command is its own class, inside of the GMLevel's command "root" class. In this case we're talking about player commands, so they are inner classes defined inside PlayerCommands.java and they extend it. This should be similar to what most people are used to by now, I think. As you can see, each command can override the description if you want it to; it will be used later on for the help command.


Finally, wire it up to the chat handler:
PHP Code:

CommandProcessor.ProcessCommandResponse cmdResponse CommandProcessor.processCommand(ctext);
switch (
cmdResponse) {
    case 
ERR_INSUFFICIENT_PRIVILEGES:
    case 
ERR_NO_COMMAND_CHAR:
        break;
    case 
ERR_NOT_A_COMMAND:
        
c.getCharacter().dropMessage("That command does not exist.");
        return;
    case 
SUCCESS:
        return;


Well, that's pretty much it for the system; I'll talk a little bit about ways to share functionality between commands and some examples of extra uses for commands.


Accessing Commands and Sharing Functionality
This isn't necessarily specific to this command system (though some of it is), but is just general good practices that I want to go over.

Example of sharing functionality through a separately defined private static function:
PHP Code:

package client.commands;

import client.MapleCharacter;
import client.MapleClient;
import client.MapleStat;
import constants.WzStrings;
import net.handler.channel.ChangeChannelHandler;
import scripting.npc.NPCScriptManager;
import scripting.quest.QuestScriptManager;
import server.DropEntryProvider;
import tools.StringUtil;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Map;

public abstract class 
PlayerCommands implements Command {

    private static 
void addStat(MapleCharacter chrMapleStat statint value) {
        if (
chr.getAp() < value) {
            
chr.dropMessage("Not enough AP.");
            return;
        } else if (
value 0) {
            
chr.dropMessage("Please enter a value greater than 0.");
            return;
        }
        
int old 0;
        if (
stat == MapleStat.STR) {
            
old chr.getStr();
            
chr.setStr(chr.getStr() + value);
        } else if (
stat == MapleStat.DEX) {
            
old chr.getDex();
            
chr.setDex(chr.getDex() + value);
        } else if (
stat == MapleStat.INT) {
            
old chr.getInt();
            
chr.setInt(chr.getInt() + value);
        } else if (
stat == MapleStat.LUK) {
            
old chr.getLuk();
            
chr.setLuk(chr.getLuk() + value);
        } else {
            
chr.dropMessage("Error!");
            return;
        }
        
chr.updateSingleStat(statold valuetrue);
        
chr.setAp(chr.getAp() - valuetrue);
    }

    public 
GMLevel getReqGMLevel() {
        return 
GMLevel.PLAYER;
    }

    public 
String getDesc() {
        return 
"";
    }

    public static class 
AddStr extends PlayerCommands {
        public 
String getName() {
            return 
"str";
        }

        public 
String getDesc() {
            return 
"Adds an amount to your " getName() + ". Syntax: @" getName() + " <value>";
        }

        public 
void run(MapleClient cString[] args) {
            
addStat(c.getCharacter(), MapleStat.STRInteger.parseInt(args[0]));
        }
    }

    public static class 
AddDex extends PlayerCommands {
        public 
String getName() {
            return 
"dex";
        }

        public 
String getDesc() {
            return 
"Adds an amount to your " getName() + ". Syntax: @" getName() + " <value>";
        }

        public 
void run(MapleClient cString[] args) {
            
addStat(c.getCharacter(), MapleStat.DEXInteger.parseInt(args[0]));
        }
    }

    public static class 
AddInt extends PlayerCommands {
        public 
String getName() {
            return 
"int";
        }

        public 
String getDesc() {
            return 
"Adds an amount to your " getName() + ". Syntax: @" getName() + " <value>";
        }

        public 
void run(MapleClient cString[] args) {
            
addStat(c.getCharacter(), MapleStat.INTInteger.parseInt(args[0]));
        }
    }

    public static class 
AddLuk extends PlayerCommands {
        public 
String getName() {
            return 
"luk";
        }

        public 
String getDesc() {
            return 
"Adds an amount to your " getName() + ". Syntax: @" getName() + " <value>";
        }

        public 
void run(MapleClient cString[] args) {
            
addStat(c.getCharacter(), MapleStat.LUKInteger.parseInt(args[0]));
        }
    } 

As you can see, there is room for improvement here, even though we've moved most of the logic to its own private function.
We can improve this code by adding an extra layer of inheritance, as demonstrated by the following example:

Example of sharing functionality by adding a layer of inheritance:
PHP Code:

package client.commands;

import client.*;
import client.inventory.IItem;
import client.inventory.InventoryType;
import client.inventory.Item;
import client.inventory.MapleInventoryManipulator;
import client.status.PlayerDisease;
import client.status.PlayerDisease.PlayerDiseaseType;
import server.life.MobSkill;
import server.life.MobSkillFactory;
import server.maps.objects.MapObjectType;
import server.maps.objects.MapleMapItem.DropType;
import server.maps.objects.MapleMapObject;
import storage.dao.DatabaseConnection;
import tools.MaplePacketCreator;
import tools.Pair;

@
Slf4j
public abstract class GMCommands implements Command {

    public 
GMLevel getReqGMLevel() {
        return 
GMLevel.GM;
    }

    public 
String getDesc() {
        return 
"";
    }

    static abstract class 
GiveDisease extends GMCommands {

        protected static 
void applyDisease(MapleCharacter chrPlayerDiseaseType tMobSkill mboolean permanent) {
            
PlayerDisease disease;
            if (
permanent) {
                
disease = new PlayerDisease(tmtrue);
            } else {
                
disease = new PlayerDisease(tmm.getDuration());
            }
            
chr.giveDisease(disease);
        }

        public abstract 
String getName();

        public abstract 
void run(MapleClient cString[] args);
    }

    public static class 
GiveSeduce extends GiveDisease {
        public 
String getName() {
            return 
"seduce";
        }

        public 
void run(MapleClient cString[] args) {
            
MapleCharacter chr c.getChannelServer().getCharacter(args[0]);
            if (
chr != null) {
                
applyDisease(chrPlayerDiseaseType.SEDUCEMobSkillFactory.getSkill(1281), false);
            }
        }
    }

    public static class 
GiveStunMap extends GiveDisease {
        public 
String getName() {
            return 
"stunmap";
        }

        public 
void run(MapleClient cString[] args) {
            for (
MapleCharacter chr c.getCharacter().getMap().getCharacters()) {
                if (
chr.getGMLevel() < GMLevel.GM.getValue())
                    
applyDisease(chrPlayerDiseaseType.STUNMobSkillFactory.getSkill(12312), true);
            }
        }
    }


Applying the above concept to the stat code, we could remove the need for separate getName() and getDesc() implementations to each command.

Accessing commands:
Sometimes you want to access all commands for a certain GMLevel. This is how to do it, and this is what the help command(s) would look like:
PHP Code:

public static class Help extends PlayerCommands {    
    public 
String getName() {
        return 
"help";
    }

    public 
void run(MapleClient cString[] args) {
        for (
Command cm CommandProcessor.commands.get(getReqGMLevel()).values()) {
            
StringBuilder cmBuilder = new StringBuilder();
            
cmBuilder.append(getReqGMLevel().getCommandChar()).append(cm.getName());
            if (!
cm.getDesc().isEmpty()) {
                
cmBuilder.append("\t-\t").append(cm.getDesc());
            }
            
c.getCharacter().dropMessage(cmBuilder.toString());
        }
    }


This is for player commands. Similar thing for gm and admin commands, but a caveat is that the highest eligible GMLevel command will be ran if multiple commands have the same name. For example, if you have a !help in GMCommands and !help in AdminCommands, if an admin types it, the admin command will be ran. You can change names to get around this, like !gmcommands and !admincommands or !gmhelp and !adminhelp, etc.

Using commands anywhere:
Naturally, there is also the flexibility of using a command anywhere in the source. For example, to bandaid a bad skill/mastery issue, some sources max all skills at login. If you have code for this in a command, using it is as simple as this (though this likely isn't unique to this system):
PHP Code:

new GMCommands.MaxSkills().run(c, new String[0]); 

Quote:

So, with that being said, some of you may like what your repack/source/whatever already uses, but I find my version mighty spiffy, and the least controversial of the attempts made by programmers-past to redo this (surprisingly) central feature.

[Help] Plus emu error furni

[Help] Pet speech

[Request] 诛神 - Zhushen server files

How to fix crash on room>>>

$
0
0
Hello
i have a problem with my server thats when we play room after while the players get crash from the server how to fix ths problem

[Help] PlusEmu help add furni

$
0
0









where is the problem ? help please

[Help] new character creation -> The inventory Period Items How to Create

$
0
0
new character creation
->
The inventory
Period Items
How to Create
need


1 week




I
Devil ITEM or


Period items all item
I want to put


New Characters
Support Items
1 week
The period Items


The inventory
I want to create

sql script




A new character

[Help] How to add teleportation system or rift in MU?

$
0
0
Hello folks, i would like to know to how add a teleportation system in Mu aside from utilizing the "M" function in game. Like when you step into that circle you are going to warp to another location/map. This was already been done before from this thread : Link, but the one responsible for it is not around?

I would also like to know how to add a rift, just like the one in noria, wherein if i clicked that rift i would teleport to another map....

and also, how would i enable "M" function in restricted areas like the Loren market?

Thanks in advance

[Unity3d Release]God of light

EU Referendum - Now LIVE

$
0
0
At the time of me making this thread, the votes for leave and remain are currently being counted. More information can be found on the link below.

EU Referendum Results - BBC News

Leave is edging ahead more and more as the tallying progresses (51.3% as I type this). Looks like the UK is gonna finally have the independence it oh so desired, unless a rush of remain votes come flooding in at the last minute. Scotland has a much larger remain total than I would've expected.

Since this is on the topic of politics I feel that this should be in debate but I'll leave that for the Outerworld mods to decide.

Discuss.

[Release]Unity Moba complete

Releash!:魔力宝贝6.0 (baby magic(?) or grass/cross gate 6.0)

$
0
0
魔力宝贝ol 6.0

http://pan.baidu.com/s/1dDnhvZr
pass: jnnn

Releashe:投名状ol

Viewing all 29686 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>