Jump to content
  • 0

Transfer Bonus Costume - HELP


GoldCash

Question

  • Answers 4
  • Created
  • Last Reply

Top Posters For This Question

Top Posters For This Question

4 answers to this question

Recommended Posts

  • 0

config.cpp

int    CostumeTransferBonusItemVnum = 71084;

config.h

extern int CostumeTransferBonusItemVnum;

char.h

void CHARACTER::CostumeBonusTransfer(DWORD cell1, DWORD cell2){
    if ((GetExchange() || IsOpenSafebox() || GetShopOwner()) || IsCubeOpen() || IsDead()){
        ChatPacket(CHAT_TYPE_INFO, "Nie mozesz teraz wykonac tej operacji!");
        return;
    }


    LPITEM costume1 = GetInventoryItem(cell1);
    if (!costume1){
        ChatPacket(CHAT_TYPE_INFO, "Nie odnaleziono pierwszego kostiumu.");
        return;
    }
    
    if (costume1->GetType() != ITEM_COSTUME || costume1->GetType() == ITEM_COSTUME && costume1->GetSubType() != COSTUME_BODY){
        ChatPacket(CHAT_TYPE_INFO, "Pierwszy przedmiot nie jest kostiumem!");
        return;
    }
    
    if (costume1->IsEquipped()){
        ChatPacket(CHAT_TYPE_INFO, "Kullanılamaz kostüm.");
        return;
    }
    
    LPITEM costume2 = GetInventoryItem(cell2);
    if (!costume2){
        ChatPacket(CHAT_TYPE_INFO, "Slotta kostüm yok.");
        return;
    }
    
    if (costume2->GetType() != ITEM_COSTUME || costume2->GetType() == ITEM_COSTUME && costume2->GetSubType() != COSTUME_BODY){
        ChatPacket(CHAT_TYPE_INFO, "Malesef bunula yapamazsın");
        return;
    }
    
    if (costume2->IsEquipped()){
        ChatPacket(CHAT_TYPE_INFO, "Böyle bir kostüm kullanamazsın");
        return;
    }
    
    if (CountSpecifyItem(CostumeTransferBonusItemVnum) < 1){
        ChatPacket(CHAT_TYPE_INFO, "Bonus yok Neyi aktaracaksın.");
        return;
    }
    
    if (costume2->GetAttributeCount() < 1){
        ChatPacket(CHAT_TYPE_INFO, "İkinci Slota İyi bak!");
        return;
    }
    
    
    RemoveSpecifyItem(CostumeTransferBonusItemVnum, 1);
    costume1->ClearAttribute();
    for (int i = 0; i < costume2->GetAttributeCount(); i++){
        costume1->SetForceAttribute(i, costume2->GetAttributeType(i), costume2->GetAttributeValue(i));
    }
    
    costume2->RemoveFromCharacter();
    
    ChatPacket(CHAT_TYPE_INFO, "Başarılı bir şekilde Transfer Edildi!");

}

char.h

void            CostumeBonusTransfer(DWORD cell1, DWORD cell2);

cmd.cpp

ACMD(do_costume_transfer_bonus);
---
{ "kostum_degis_bonus",do_costume_transfer_bonus,0,POS_DEAD,GM_PLAYER},

Cmd_general.cpp

ACMD(do_costume_transfer_bonus){
    char arg1[256], arg2[256];
    DWORD cell1, cell2;
    two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));


    if (!*arg1 || !*arg2)
        return;
    str_to_number(cell1, arg1);
    str_to_number(cell2, arg2);


    if (cell1 < 0 || cell1 > INVENTORY_MAX_NUM || cell2 < 0 || cell2 > INVENTORY_MAX_NUM || cell1 == cell2)
        return;


    ch->CostumeBonusTransfer(cell1, cell2);

}

I hope I helped you on the c++ side

Link to comment
Share on other sites

  • 0
3 hours ago, Bathaar said:

config.cpp

int    CostumeTransferBonusItemVnum = 71084;

config.h

extern int CostumeTransferBonusItemVnum;

char.h

void CHARACTER::CostumeBonusTransfer(DWORD cell1, DWORD cell2){
    if ((GetExchange() || IsOpenSafebox() || GetShopOwner()) || IsCubeOpen() || IsDead()){
        ChatPacket(CHAT_TYPE_INFO, "Nie mozesz teraz wykonac tej operacji!");
        return;
    }


    LPITEM costume1 = GetInventoryItem(cell1);
    if (!costume1){
        ChatPacket(CHAT_TYPE_INFO, "Nie odnaleziono pierwszego kostiumu.");
        return;
    }
    
    if (costume1->GetType() != ITEM_COSTUME || costume1->GetType() == ITEM_COSTUME && costume1->GetSubType() != COSTUME_BODY){
        ChatPacket(CHAT_TYPE_INFO, "Pierwszy przedmiot nie jest kostiumem!");
        return;
    }
    
    if (costume1->IsEquipped()){
        ChatPacket(CHAT_TYPE_INFO, "Kullanılamaz kostüm.");
        return;
    }
    
    LPITEM costume2 = GetInventoryItem(cell2);
    if (!costume2){
        ChatPacket(CHAT_TYPE_INFO, "Slotta kostüm yok.");
        return;
    }
    
    if (costume2->GetType() != ITEM_COSTUME || costume2->GetType() == ITEM_COSTUME && costume2->GetSubType() != COSTUME_BODY){
        ChatPacket(CHAT_TYPE_INFO, "Malesef bunula yapamazsın");
        return;
    }
    
    if (costume2->IsEquipped()){
        ChatPacket(CHAT_TYPE_INFO, "Böyle bir kostüm kullanamazsın");
        return;
    }
    
    if (CountSpecifyItem(CostumeTransferBonusItemVnum) < 1){
        ChatPacket(CHAT_TYPE_INFO, "Bonus yok Neyi aktaracaksın.");
        return;
    }
    
    if (costume2->GetAttributeCount() < 1){
        ChatPacket(CHAT_TYPE_INFO, "İkinci Slota İyi bak!");
        return;
    }
    
    
    RemoveSpecifyItem(CostumeTransferBonusItemVnum, 1);
    costume1->ClearAttribute();
    for (int i = 0; i < costume2->GetAttributeCount(); i++){
        costume1->SetForceAttribute(i, costume2->GetAttributeType(i), costume2->GetAttributeValue(i));
    }
    
    costume2->RemoveFromCharacter();
    
    ChatPacket(CHAT_TYPE_INFO, "Başarılı bir şekilde Transfer Edildi!");

}

char.h

void            CostumeBonusTransfer(DWORD cell1, DWORD cell2);

cmd.cpp

ACMD(do_costume_transfer_bonus);
---
{ "kostum_degis_bonus",do_costume_transfer_bonus,0,POS_DEAD,GM_PLAYER},

Cmd_general.cpp

ACMD(do_costume_transfer_bonus){
    char arg1[256], arg2[256];
    DWORD cell1, cell2;
    two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));


    if (!*arg1 || !*arg2)
        return;
    str_to_number(cell1, arg1);
    str_to_number(cell2, arg2);


    if (cell1 < 0 || cell1 > INVENTORY_MAX_NUM || cell2 < 0 || cell2 > INVENTORY_MAX_NUM || cell1 == cell2)
        return;


    ch->CostumeBonusTransfer(cell1, cell2);

}

I hope I helped you on the c++ side

There is nothing like that in my source

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.