سلام ، آیا این بازدید اول شماست ؟ یا
logo_forum_header

تبلیغات
×
+
سفارش تبلیغات

صفحه 1 از 2 12 آخرینآخرین
نمایش نتایج: از 1 به 10 از 13

موضوع: اسکریپت Duel Sharty

  1. #1
    جایزه ها:
    پایان دهنده بحث ها

    شماره عضویت
    8
    تاریخ عضویت
    Oct 2014
    نوشته ها
    256
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پسندیده : 110
    مورد پسند : 311 بار در 153 پست
    سیستم عامل و مرورگر:

    اسکریپت Duel Sharty

    با سلام

    اینم اسکریپت Duel Sharty هست

    کد PHP:
        #include "ScriptPCH.h"
         
        // Set USE_TOKEN to 1 if you want to have it use tokens in place of gold
        #define USE_TOKEN       1
        #define TOKEN_ID        49426
         
        
    struct BloodMoneyInfo
        
    {
                
    uint64 guid;
                
    uint32 amount;
                
    bool accepted;
        };
         
        
    typedef std::list<BloodMoneyInfoBloodMoneyList;
        
    typedef std::map<uint64BloodMoneyListBloodMoney;
        static 
    BloodMoney m_bloodMoney;
         
        
    bool HasBloodMoneyChallenger(uint64 playerGUID)
        {
                return 
    m_bloodMoney.find(playerGUID) != m_bloodMoney.end();
        }
         
        
    bool HasBloodMoneyChallenger(uint64 targetGUIDuint64 playerGUID)
        {
                if (!
    HasBloodMoneyChallenger(targetGUID))
                        return 
    false;
                
    BloodMoneyList bml m_bloodMoney[targetGUID];
                for (
    BloodMoneyList::const_iterator itr bml.begin(); itr != bml.end(); ++itr)
                        if (
    itr->guid == playerGUID)
                                return 
    true;
                return 
    false;
        }
         
        
    void AddBloodMoneyEntry(uint64 targetGUIDuint64 playerGUIDuint32 amount)
        {
                
    BloodMoneyInfo bmi;
                
    bmi.guid playerGUID;
                
    bmi.amount amount;
                
    bmi.accepted false;
                
    m_bloodMoney[targetGUID].push_back(bmi);
        }
         
        
    void RemoveBloodMoneyEntry(uint64 targetGUIDuint64 playerGUID)
        {
                if (!
    HasBloodMoneyChallenger(targetGUIDplayerGUID))
                        return;
                
    BloodMoneyList &list = m_bloodMoney[targetGUID];
                
    BloodMoneyList::iterator itr;
                for (
    itr = list.begin(); itr != list.begin(); ++itr)
                        if (
    itr->guid == playerGUID)
                                break;
                list.
    erase(itr);
        }
         
        
    void SetChallengeAccepted(uint64 targetGUIDuint64 playerGUID)
        {
                if (!
    HasBloodMoneyChallenger(targetGUIDplayerGUID))
                        return;
                
    BloodMoneyList &list = m_bloodMoney[targetGUID];
                
    BloodMoneyList::iterator itr;
                for (
    itr = list.begin(); itr != list.end(); ++itr)
                {
                        if (
    itr->guid == playerGUID)
                        {
                                
    itr->accepted true;
                                break;
                        }
                }
        }
         
        class 
    npc_blood_money : public CreatureScript
        
    {
                public :
                        
    npc_blood_money() : CreatureScript("npc_blood_money") {}
         
                
    bool OnGossipHello(Player playerCreature creature)
                {
                        
    player->PlayerTalkClass->ClearMenus();
                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE"Challenge a Player"111000);   
                        if (
    HasBloodMoneyChallenger(player->GetGUID()))
                        {
                                
    BloodMoneyList list = m_bloodMoney[player->GetGUID()];
                                for (
    BloodMoneyList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
                                {
                                        
    char msg[50];
         
                                        if (
    Playerplr Player::GetPlayer(*playeritr->guid))
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        
    sprintf(msg"Accept %s's Challenge of %d tokens"plr->GetName().c_str(), itr->amount);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_MAINitr->guid);
                                                        
    sprintf(msg"Decline %s's Challenge of %d tokens"plr->GetName().c_str(), itr->amount);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_INFOitr->guid);
                                                }
                                                else
                                                {
                                                        
    sprintf(msg"Accept %s's Challenge of %dg"plr->GetName().c_str(), itr->amount/10000);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_MAINitr->guid);
                                                        
    sprintf(msg"Decline %s's Challenge of %dg"plr->GetName().c_str(), itr->amount/10000);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_INFOitr->guid);
                                                }
                                               
                                        }
                                }
                        }
                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT"Nevermind"GOSSIP_SENDER_MAIN1);
                       
                        
    player->SEND_GOSSIP_MENU(80025creature->GetGUID());
         
                        return 
    true;
                }
         
                
    bool OnGossipSelect(Player playerCreature creatureuint32 uiSenderuint32 uiAction)
                {
                        
    player->PlayerTalkClass->ClearMenus();
                        if (
    uiAction == 1)
                        {
                                
    player->CLOSE_GOSSIP_MENU();
                                return 
    true;
                        }
                        switch(
    uiSender)
                        {
                                case 
    GOSSIP_SENDER_MAIN:
                                        if (
    Playertarget Player::GetPlayer(*playeruiAction))
                                        {
                                                
    SetChallengeAccepted(player->GetGUID(), target->GetGUID());
                                                
    char msg[60];
                                                
    sprintf(msg"%s has accepted your challenge!"player->GetName().c_str());
                                                
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                
    player->CLOSE_GOSSIP_MENU();
                                        }
                                        break;
                                case 
    GOSSIP_SENDER_INFO:
                                        if (
    Playertarget Player::GetPlayer(*playeruiAction))
                                        {
                                                
    char msg[60];
                                                
    sprintf(msg"%s has declined your challenge!"player->GetName().c_str());
                                                
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                
    RemoveBloodMoneyEntry(player->GetGUID(), uiAction);
                                                
    OnGossipHello(playercreature);
                                        }
                                        break;
                                case 
    11:
                                        if (
    USE_TOKEN)
                                        {
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Duel Sharti Baraye 2 Emblem of frost"GOSSIP_SENDER_MAIN2"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 4 Emblem of frost"GOSSIP_SENDER_MAIN4"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 6 Emblem of frost"GOSSIP_SENDER_MAIN6"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 8 Emblem of frost"GOSSIP_SENDER_MAIN8"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 10 Emblem of frost"GOSSIP_SENDER_MAIN10"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 12 Emblem of frost"GOSSIP_SENDER_MAIN12"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 14 Emblem of frost"GOSSIP_SENDER_MAIN14"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 16 Emblem of frost"GOSSIP_SENDER_MAIN16"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 18 Emblem of frost"GOSSIP_SENDER_MAIN18"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 20 Emblem of frost"GOSSIP_SENDER_MAIN20"Type in the player's name"0true);
                                        }
                                        else
                                        {
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 2g"GOSSIP_SENDER_MAIN2"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 4g"GOSSIP_SENDER_MAIN4"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 6g"GOSSIP_SENDER_MAIN6"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 8g"GOSSIP_SENDER_MAIN8"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 10g"GOSSIP_SENDER_MAIN10"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 12g"GOSSIP_SENDER_MAIN12"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 14g"GOSSIP_SENDER_MAIN14"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 16g"GOSSIP_SENDER_MAIN16"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 18g"GOSSIP_SENDER_MAIN18"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 20g"GOSSIP_SENDER_MAIN20"Type in the player's name"0true);
                                        }
                                       
                                        
    player->SEND_GOSSIP_MENU(80025creature->GetGUID());
                                        break;
                        }
                        return 
    true;
                }
         
                
    bool OnGossipSelectCode(PlayerplayerCreaturecreatureuint32 senderuint32 action, const charcode)
                {
                        if (
    player->GetName().c_str() == code)
                        {
                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFNow why would you want to challenge yourself?");
                                return 
    false;
                        }
                        if (
    uint64 targetGUID sObjectMgr->GetPlayerGUIDByName(code))
                        {
                                if (
    Playertarget Player::GetPlayer(*playertargetGUID))
                                {
                                        if (
    target->GetGUID() == player->GetGUID())
                                        {
                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFNow why would you want to challenge yourself?");
                                                return 
    false;
                                        }
                                        if (
    target->GetZoneId() == player->GetZoneId())
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        if (
    target->GetItemCount(TOKEN_ID) < action)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player does not have enough tokens to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
                                                        if (
    player->GetItemCount(TOKEN_ID) < action)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou do not have enough tokens to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
                                                       
                                                        
    bool found false;
                                                        if (
    HasBloodMoneyChallenger(player->GetGUID()))
                                                        {
                                                                
    BloodMoneyList list = m_bloodMoney[player->GetGUID()];
                                                                for (
    BloodMoneyList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
                                                                        if (
    itr->guid == target->GetGUID())
                                                                                
    found true;
                                                        }
                                                        if (!
    found)
                                                        {
                                                                if (!
    HasBloodMoneyChallenger(target->GetGUID(), player->GetGUID()))
                                                                {
                                                                        
    AddBloodMoneyEntry(target->GetGUID(), player->GetGUID(), action);
                                                                        
    char msg[60];
                                                                        
    sprintf(msg"%s Darkhaste Duel Sharti Ba Shoma Karde!"player->GetName().c_str());
                                                                        
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                                }
                                                                else
                                                                        
    ChatHandler(target->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with the same person!");
                                                        }
                                                        else
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with somebody that has challenged you!");
                                                        
    player->CLOSE_GOSSIP_MENU();
                                                        return 
    true;
                                                }
                                                else
                                                {
                                                        
    uint32 money action*10000;
                                                        if (
    target->GetMoney() < money)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player does not have enough money to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
                                                        if (
    player->GetMoney() < money)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou do not have enough money to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
         
                                                        
    bool found false;
                                                        if (
    HasBloodMoneyChallenger(player->GetGUID()))
                                                        {
                                                                
    BloodMoneyList list = m_bloodMoney[player->GetGUID()];
                                                                for (
    BloodMoneyList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
                                                                        if (
    itr->guid == target->GetGUID())
                                                                                
    found true;
                                                        }
                                                        if (!
    found)
                                                        {
                                                                if (!
    HasBloodMoneyChallenger(target->GetGUID(), player->GetGUID()))
                                                                {
                                                                        
    AddBloodMoneyEntry(target->GetGUID(), player->GetGUID(), money);
                                                                        
    char msg[60];
                                                                        
    sprintf(msg"%s Darkhaste Duel Sharti Ba Shoma Karde!"player->GetName().c_str());
                                                                        
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                                }
                                                                else
                                                                        
    ChatHandler(target->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with the same person!");
                                                        }
                                                        else
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with somebody that has challenged you!");
                                                        
    player->CLOSE_GOSSIP_MENU();
                                                        return 
    true;
                                                }
                                               
                                        }
                                        else
                                        {
                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player is not in your zone!");
                                                
    player->CLOSE_GOSSIP_MENU();
                                                return 
    false;
                                        }
                                }
                                else
                                {
                                        
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player was not found!");
                                        
    player->CLOSE_GOSSIP_MENU();
                                        return 
    false;
                                }
                        }
                        else
                        {
                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player was not found!");
                                
    player->CLOSE_GOSSIP_MENU();
                                return 
    false;
                        }
                        
    player->CLOSE_GOSSIP_MENU();
                        return 
    true;
                }
         
        };
         
        class 
    BloodMoneyReward : public PlayerScript
        
    {
         public:
                 
    BloodMoneyReward() : PlayerScript("BloodMoneyReward") {}
                 
                
    void OnDuelEnd(PlayerwinnerPlayerloserDuelCompleteType type)
                {
                        if (
    HasBloodMoneyChallenger(winner->GetGUID()) || HasBloodMoneyChallenger(loser->GetGUID()))
                        {                        
                                
    BloodMoneyList list1 m_bloodMoney[winner->GetGUID()];
                                
    BloodMoneyList list2 m_bloodMoney[loser->GetGUID()];
         
                                
    BloodMoneyList::const_iterator itr;
                                for (
    itr list1.begin(); itr != list1.end(); ++itr)
                                {
                                        if (
    itr->guid == loser->GetGUID() && itr->accepted)
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        if (
    winner->GetItemCount(TOKEN_ID) < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any tokens because of this.");
                                                                
    RemoveBloodMoneyEntry(winner->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetItemCount(TOKEN_ID) >= itr->amount)
                                                        {
                                                                
    winner->AddItem(TOKEN_IDitr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %d tokens!"itr->amount);
                                                                
    Itemitem loser->GetItemByEntry(TOKEN_ID);
                                                                
    loser->DestroyItemCount(TOKEN_IDitr->amounttrue);
                                                                
    RemoveBloodMoneyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough tokens to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveBloodMoneyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                                else
                                                {
                                                        if (
    winner->GetMoney() < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any money because of this.");
                                                                
    RemoveBloodMoneyEntry(winner->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetMoney() >= itr->amount)
                                                        {
                                                                
    winner->ModifyMoney(itr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %dg!"itr->amount/10000);
                                                                
    loser->ModifyMoney(-(int32)(itr->amount));
                                                                
    RemoveBloodMoneyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough money to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveBloodMoneyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                        }
                                }
                                for (
    itr list2.begin(); itr != list2.end(); ++itr)
                                {
                                        if (
    itr->guid == winner->GetGUID() && itr->accepted)
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        if (
    winner->GetItemCount(TOKEN_ID) < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any tokens because of this.");
                                                                
    RemoveBloodMoneyEntry(loser->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetItemCount(TOKEN_ID) >= itr->amount)
                                                        {
                                                                
    winner->AddItem(TOKEN_IDitr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %d tokens!"itr->amount);
                                                                
    Itemitem loser->GetItemByEntry(TOKEN_ID);
                                                                
    loser->DestroyItemCount(TOKEN_IDitr->amounttrue);
                                                                
    RemoveBloodMoneyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough tokens to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveBloodMoneyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                                else
                                                {
                                                        if (
    winner->GetMoney() < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any money because of this.");
                                                                
    RemoveBloodMoneyEntry(loser->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetMoney() >= itr->amount)
                                                        {
                                                                
    winner->ModifyMoney(itr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %dg!"itr->amount/10000);
                                                                
    loser->ModifyMoney(-(int32)(itr->amount));
                                                                
    RemoveBloodMoneyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough money to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveBloodMoneyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                        }
                                }
         
                         }
                 }
        };
         
        
    void AddSC_npc_blood_money()
        {
                new 
    BloodMoneyReward();
                new 
    npc_blood_money();
        } 

    کاربر مقابل پست Ezio عزیز را پسندیده است:

    Nightprince (10-28-2014)

    مردم دنیا زمان رو 3 حالت می بینن

    اما ما ایرانیا 4 حالت:

    زمان گذشته ، زمان حال ، زمان آینده ، زمـــان شـــــــاہ.....!!!!

    Hamed.Wower@yahoo.com

  2. # ADS
    سیستم تبلیغات
    تاریخ عضویت
    01/01/2014
    نوشته ها
    پستی ندارد.
     

  3. #2

    شماره عضویت
    92
    تاریخ عضویت
    Dec 2014
    محل سکونت
    گلستان
    نوشته ها
    97
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 53
    مورد پسند : 56 بار در 29 پست
    سیستم عامل و مرورگر:
    میشه برای 434 استفاده کرد و بجای فراست چیز دیگه گذاشت؟
    هیچ چیز انی نیست که در نگاه اول به نظر میرسد (اهورا)

  4. #3
    دستاورد ها:
    اجتماعیRecommendation First Class1 سال ثبت نام شده استبرچسب زن کلاس اولاوردرایو

    شماره عضویت
    1
    تاریخ عضویت
    Oct 2014
    محل سکونت
    بوشهر
    نوشته ها
    1,774
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 725
    مورد پسند : 1,164 بار در 582 پست
    سیستم عامل و مرورگر:
    بله اگه اررور هاش رو فیکس کنی هر چیزی بخوای میشه جای Frost گذاشت .

    این رو :

    #define TOKEN_ID 49426


    49426 رو عوض کنی توکن عوض میشه .

  5. #4

    شماره عضویت
    92
    تاریخ عضویت
    Dec 2014
    محل سکونت
    گلستان
    نوشته ها
    97
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 53
    مورد پسند : 56 بار در 29 پست
    سیستم عامل و مرورگر:
    انجام دادم و کامل کار کرد فقط یه چیزی ٰ میخواستم میشه هم سر ایتم شرط بست هم سر گلد مثلا شاید کسی اون ایتم مورد نظر که من گذاشتم رو نداشته باشه و بخواد با گلد شرط بندی کنه
    هیچ چیز انی نیست که در نگاه اول به نظر میرسد (اهورا)

  6. #5
    دستاورد ها:
    اجتماعیRecommendation First Class1 سال ثبت نام شده استبرچسب زن کلاس اولاوردرایو

    شماره عضویت
    1
    تاریخ عضویت
    Oct 2014
    محل سکونت
    بوشهر
    نوشته ها
    1,774
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 725
    مورد پسند : 1,164 بار در 582 پست
    سیستم عامل و مرورگر:
    از همین یک کپی بگیر بعد bool ها , Void ها و ... رو عوض کن بعد توکن براش نزار میشه Duel Sharti با Gold .

  7. #6

    شماره عضویت
    92
    تاریخ عضویت
    Dec 2014
    محل سکونت
    گلستان
    نوشته ها
    97
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 53
    مورد پسند : 56 بار در 29 پست
    سیستم عامل و مرورگر:
    میشه ادیت کنید و نسخه کامل رو بزارید؟
    هیچ چیز انی نیست که در نگاه اول به نظر میرسد (اهورا)

  8. #7
    دستاورد ها:
    اجتماعیRecommendation First Class1 سال ثبت نام شده استبرچسب زن کلاس اولاوردرایو

    شماره عضویت
    1
    تاریخ عضویت
    Oct 2014
    محل سکونت
    بوشهر
    نوشته ها
    1,774
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 725
    مورد پسند : 1,164 بار در 582 پست
    سیستم عامل و مرورگر:
    کد PHP:
      #include "ScriptPCH.h"
         
        #define USE_TOKEN       1
        #define TOKEN_ID        
        
    struct DuelShartyInfo
        
    {
                
    uint64 guid;
                
    uint32 amount;
                
    bool accepted;
        };
        
    typedef std::list<DuelShartyInfoDuelShartyList;
        
    typedef std::map<uint64DuelShartyListDuelSharty;
        static 
    DuelSharty m_duelSharty;
        
    bool HasDuelShartyChallenger(uint64 playerGUID)
        {
                return 
    m_duelSharty.find(playerGUID) != m_duelSharty.end();
        }
        
    bool HasDuelShartyChallenger(uint64 targetGUIDuint64 playerGUID)
        {
                if (!
    HasDuelShartyChallenger(targetGUID))
                        return 
    false;
                
    DuelShartyList bml m_duelSharty[targetGUID];
                for (
    DuelShartyList::const_iterator itr bml.begin(); itr != bml.end(); ++itr)
                        if (
    itr->guid == playerGUID)
                                return 
    true;
                return 
    false;
        }  
        
    void AddDuelShartyEntry(uint64 targetGUIDuint64 playerGUIDuint32 amount)
        {
                
    DuelShartyInfo bmi;
                
    bmi.guid playerGUID;
                
    bmi.amount amount;
                
    bmi.accepted false;
                
    m_duelSharty[targetGUID].push_back(bmi);
        }
        
    void RemoveDuelShartyEntry(uint64 targetGUIDuint64 playerGUID)
        {
                if (!
    HasDuelShartyChallenger(targetGUIDplayerGUID))
                        return;
                
    DuelShartyList &list = m_duelSharty[targetGUID];
                
    DuelShartyList::iterator itr;
                for (
    itr = list.begin(); itr != list.begin(); ++itr)
                        if (
    itr->guid == playerGUID)
                                break;
                list.
    erase(itr);
        }
         
        
    void SetChallengeAccepted(uint64 targetGUIDuint64 playerGUID)
        {
                if (!
    HasDuelShartyChallenger(targetGUIDplayerGUID))
                        return;
                
    DuelShartyList &list = m_duelSharty[targetGUID];
                
    DuelShartyList::iterator itr;
                for (
    itr = list.begin(); itr != list.end(); ++itr)
                {
                        if (
    itr->guid == playerGUID)
                        {
                                
    itr->accepted true;
                                break;
                        }
                }
        }
        class 
    npc_duel_sharty : public CreatureScript
        
    {
                public :
                        
    npc_duel_sharty() : CreatureScript("npc_duel_sharty") {}
                
    bool OnGossipHello(Player playerCreature creature)
                {
                        
    player->PlayerTalkClass->ClearMenus();
                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_BATTLE"Challenge a Player"111000);   
                        if (
    HasDuelShartyChallenger(player->GetGUID()))
                        {
                                
    DuelShartyList list = m_duelSharty[player->GetGUID()];
                                for (
    DuelShartyList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
                                {
                                        
    char msg[50];
         
                                        if (
    Playerplr Player::GetPlayer(*playeritr->guid))
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        
    sprintf(msg"Accept %s's Challenge of %d tokens"plr->GetName().c_str(), itr->amount);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_MAINitr->guid);
                                                        
    sprintf(msg"Decline %s's Challenge of %d tokens"plr->GetName().c_str(), itr->amount);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_INFOitr->guid);
                                                }
                                                else
                                                {
                                                        
    sprintf(msg"Accept %s's Challenge of %dg"plr->GetName().c_str(), itr->amount/10000);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_MAINitr->guid);
                                                        
    sprintf(msg"Decline %s's Challenge of %dg"plr->GetName().c_str(), itr->amount/10000);
                                                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_INTERACT_1msgGOSSIP_SENDER_INFOitr->guid);
                                                }
                                               
                                        }
                                }
                        }
                        
    player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT"Nevermind"GOSSIP_SENDER_MAIN1);
                       
                        
    player->SEND_GOSSIP_MENU(80025creature->GetGUID());
         
                        return 
    true;
                }
                
    bool OnGossipSelect(Player playerCreature creatureuint32 uiSenderuint32 uiAction)
                {
                        
    player->PlayerTalkClass->ClearMenus();
                        if (
    uiAction == 1)
                        {
                                
    player->CLOSE_GOSSIP_MENU();
                                return 
    true;
                        }
                        switch(
    uiSender)
                        {
                                case 
    GOSSIP_SENDER_MAIN:
                                        if (
    Playertarget Player::GetPlayer(*playeruiAction))
                                        {
                                                
    SetChallengeAccepted(player->GetGUID(), target->GetGUID());
                                                
    char msg[60];
                                                
    sprintf(msg"%s has accepted your challenge!"player->GetName().c_str());
                                                
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                
    player->CLOSE_GOSSIP_MENU();
                                        }
                                        break;
                                case 
    GOSSIP_SENDER_INFO:
                                        if (
    Playertarget Player::GetPlayer(*playeruiAction))
                                        {
                                                
    char msg[60];
                                                
    sprintf(msg"%s has declined your challenge!"player->GetName().c_str());
                                                
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                
    RemoveDuelShartyEntry(player->GetGUID(), uiAction);
                                                
    OnGossipHello(playercreature);
                                        }
                                        break;
                                case 
    11:
                                        if (
    USE_TOKEN)
                                        {
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Duel Sharti Baraye 2 Emblem of frost"GOSSIP_SENDER_MAIN2"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 4 Emblem of frost"GOSSIP_SENDER_MAIN4"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 6 Emblem of frost"GOSSIP_SENDER_MAIN6"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 8 Emblem of frost"GOSSIP_SENDER_MAIN8"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 10 Emblem of frost"GOSSIP_SENDER_MAIN10"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 12 Emblem of frost"GOSSIP_SENDER_MAIN12"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 14 Emblem of frost"GOSSIP_SENDER_MAIN14"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 16 Emblem of frost"GOSSIP_SENDER_MAIN16"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 18 Emblem of frost"GOSSIP_SENDER_MAIN18"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Shart Bandi Baraye 20 Emblem of frost"GOSSIP_SENDER_MAIN20"Type in the player's name"0true);
                                        }
                                        else
                                        {
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 2g"GOSSIP_SENDER_MAIN2"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 4g"GOSSIP_SENDER_MAIN4"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 6g"GOSSIP_SENDER_MAIN6"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 8g"GOSSIP_SENDER_MAIN8"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 10g"GOSSIP_SENDER_MAIN10"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 12g"GOSSIP_SENDER_MAIN12"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 14g"GOSSIP_SENDER_MAIN14"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 16g"GOSSIP_SENDER_MAIN16"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 18g"GOSSIP_SENDER_MAIN18"Type in the player's name"0true);
                                                
    player->ADD_GOSSIP_ITEM_EXTENDED(GOSSIP_ICON_MONEY_BAG"Bet 20g"GOSSIP_SENDER_MAIN20"Type in the player's name"0true);
                                        }
                                       
                                        
    player->SEND_GOSSIP_MENU(80025creature->GetGUID());
                                        break;
                        }
                        return 
    true;
                }
         
                
    bool OnGossipSelectCode(PlayerplayerCreaturecreatureuint32 senderuint32 action, const charcode)
                {
                        if (
    player->GetName().c_str() == code)
                        {
                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFNow why would you want to challenge yourself?");
                                return 
    false;
                        }
                        if (
    uint64 targetGUID sObjectMgr->GetPlayerGUIDByName(code))
                        {
                                if (
    Playertarget Player::GetPlayer(*playertargetGUID))
                                {
                                        if (
    target->GetGUID() == player->GetGUID())
                                        {
                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFNow why would you want to challenge yourself?");
                                                return 
    false;
                                        }
                                        if (
    target->GetZoneId() == player->GetZoneId())
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        if (
    target->GetItemCount(TOKEN_ID) < action)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player does not have enough tokens to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
                                                        if (
    player->GetItemCount(TOKEN_ID) < action)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou do not have enough tokens to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
                                                       
                                                        
    bool found false;
                                                        if (
    HasDuelShartyChallenger(player->GetGUID()))
                                                        {
                                                                
    DuelShartyList list = m_duelSharty[player->GetGUID()];
                                                                for (
    DuelShartyList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
                                                                        if (
    itr->guid == target->GetGUID())
                                                                                
    found true;
                                                        }
                                                        if (!
    found)
                                                        {
                                                                if (!
    HasDuelShartyChallenger(target->GetGUID(), player->GetGUID()))
                                                                {
                                                                        
    AddDuelShartyEntry(target->GetGUID(), player->GetGUID(), action);
                                                                        
    char msg[60];
                                                                        
    sprintf(msg"%s Darkhaste Duel Sharti Ba Shoma Karde!"player->GetName().c_str());
                                                                        
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                                }
                                                                else
                                                                        
    ChatHandler(target->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with the same person!");
                                                        }
                                                        else
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with somebody that has challenged you!");
                                                        
    player->CLOSE_GOSSIP_MENU();
                                                        return 
    true;
                                                }
                                                else
                                                {
                                                        
    uint32 money action*10000;
                                                        if (
    target->GetMoney() < money)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player does not have enough money to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
                                                        if (
    player->GetMoney() < money)
                                                        {
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou do not have enough money to make Duel Sharti!");
                                                                
    player->CLOSE_GOSSIP_MENU();
                                                                return 
    false;
                                                        }
         
                                                        
    bool found false;
                                                        if (
    HasDuelShartyChallenger(player->GetGUID()))
                                                        {
                                                                
    DuelShartyList list = m_duelSharty[player->GetGUID()];
                                                                for (
    DuelShartyList::const_iterator itr = list.begin(); itr != list.end(); ++itr)
                                                                        if (
    itr->guid == target->GetGUID())
                                                                                
    found true;
                                                        }
                                                        if (!
    found)
                                                        {
                                                                if (!
    HasDuelShartyChallenger(target->GetGUID(), player->GetGUID()))
                                                                {
                                                                        
    AddDuelShartyEntry(target->GetGUID(), player->GetGUID(), money);
                                                                        
    char msg[60];
                                                                        
    sprintf(msg"%s Darkhaste Duel Sharti Ba Shoma Karde!"player->GetName().c_str());
                                                                        
    creature->MonsterWhisper(msgtarget->GetGUID(), true);
                                                                }
                                                                else
                                                                        
    ChatHandler(target->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with the same person!");
                                                        }
                                                        else
                                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou cannot request a duel with somebody that has challenged you!");
                                                        
    player->CLOSE_GOSSIP_MENU();
                                                        return 
    true;
                                                }
                                               
                                        }
                                        else
                                        {
                                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player is not in your zone!");
                                                
    player->CLOSE_GOSSIP_MENU();
                                                return 
    false;
                                        }
                                }
                                else
                                {
                                        
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player was not found!");
                                        
    player->CLOSE_GOSSIP_MENU();
                                        return 
    false;
                                }
                        }
                        else
                        {
                                
    ChatHandler(player->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFThat player was not found!");
                                
    player->CLOSE_GOSSIP_MENU();
                                return 
    false;
                        }
                        
    player->CLOSE_GOSSIP_MENU();
                        return 
    true;
                }
         
        };
         
        class 
    DuelShartyReward : public PlayerScript
        
    {
         public:
                 
    DuelShartyReward() : PlayerScript("DuelShartyReward") {}
                 
                
    void OnDuelEnd(PlayerwinnerPlayerloserDuelCompleteType type)
                {
                        if (
    HasDuelShartyChallenger(winner->GetGUID()) || HasDuelShartyChallenger(loser->GetGUID()))
                        {                        
                                
    DuelShartyList list1 m_duelSharty[winner->GetGUID()];
                                
    DuelShartyList list2 m_duelSharty[loser->GetGUID()];
         
                                
    DuelShartyList::const_iterator itr;
                                for (
    itr list1.begin(); itr != list1.end(); ++itr)
                                {
                                        if (
    itr->guid == loser->GetGUID() && itr->accepted)
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        if (
    winner->GetItemCount(TOKEN_ID) < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any tokens because of this.");
                                                                
    RemoveDuelShartyEntry(winner->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetItemCount(TOKEN_ID) >= itr->amount)
                                                        {
                                                                
    winner->AddItem(TOKEN_IDitr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %d tokens!"itr->amount);
                                                                
    Itemitem loser->GetItemByEntry(TOKEN_ID);
                                                                
    loser->DestroyItemCount(TOKEN_IDitr->amounttrue);
                                                                
    RemoveDuelShartyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough tokens to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveDuelShartyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                                else
                                                {
                                                        if (
    winner->GetMoney() < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any money because of this.");
                                                                
    RemoveDuelShartyEntry(winner->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetMoney() >= itr->amount)
                                                        {
                                                                
    winner->ModifyMoney(itr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %dg!"itr->amount/10000);
                                                                
    loser->ModifyMoney(-(int32)(itr->amount));
                                                                
    RemoveDuelShartyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough money to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveDuelShartyEntry(winner->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                        }
                                }
                                for (
    itr list2.begin(); itr != list2.end(); ++itr)
                                {
                                        if (
    itr->guid == winner->GetGUID() && itr->accepted)
                                        {
                                                if (
    USE_TOKEN)
                                                {
                                                        if (
    winner->GetItemCount(TOKEN_ID) < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any tokens because of this.");
                                                                
    RemoveDuelShartyEntry(loser->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetItemCount(TOKEN_ID) >= itr->amount)
                                                        {
                                                                
    winner->AddItem(TOKEN_IDitr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %d tokens!"itr->amount);
                                                                
    Itemitem loser->GetItemByEntry(TOKEN_ID);
                                                                
    loser->DestroyItemCount(TOKEN_IDitr->amounttrue);
                                                                
    RemoveDuelShartyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough tokens to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveDuelShartyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                                else
                                                {
                                                        if (
    winner->GetMoney() < itr->amount)
                                                        {
                                                                
    winner->AddAura(15007winner);         // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. Don't worry you did not lose any money because of this.");
                                                                
    RemoveDuelShartyEntry(loser->GetGUID(), itr->guid);
                                                                return;
                                                        }
                                                        if (
    loser->GetMoney() >= itr->amount)
                                                        {
                                                                
    winner->ModifyMoney(itr->amount);
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFCongratulations on winning %dg!"itr->amount/10000);
                                                                
    loser->ModifyMoney(-(int32)(itr->amount));
                                                                
    RemoveDuelShartyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        else
                                                        {
                                                                
    loser->AddAura(15007loser);           // Apply Rez sickness for possible cheating
                                                                
    ChatHandler(winner->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYour opponent tried to cheat you. He did not have enough money to pay off the bet.");
                                                                
    ChatHandler(loser->GetSession()).PSendSysMessage("|cff800C0C[Duel Sharti] |cffFFFFFFYou have gained Resurrection Sickness for possibly trying to abuse the system.");
                                                                
    RemoveDuelShartyEntry(loser->GetGUID(), itr->guid);
                                                        }
                                                        return;
                                                }
                                        }
                                }
         
                         }
                 }
        };
         
        
    void AddSC_npc_duel_sharty()
        {
                new 
    DuelShartyReward();
                new 
    npc_duel_sharty();
        } 

  9. #8
    دستاورد ها:
    1 سال ثبت نام شده استبرچسب زن کلاس اول۱۰۰۰ امتیاز

    شماره عضویت
    165
    تاریخ عضویت
    Feb 2015
    نوشته ها
    50
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پسندیده : 2
    مورد پسند : 7 بار در 7 پست
    سیستم عامل و مرورگر:
    اخرین اپدیت ترینیتی اضاف کردم بعد کامپایل عرور میده

    میگه کلمه player نمیشناسم یه همچین اخطاری میده

    اگر میشه یه نسخه مطالق با اپدیت اخر ترینیتی بدید ممنون

  10. #9
    دستاورد ها:
    اجتماعیRecommendation First Class1 سال ثبت نام شده استبرچسب زن کلاس اولاوردرایو

    شماره عضویت
    1
    تاریخ عضویت
    Oct 2014
    محل سکونت
    بوشهر
    نوشته ها
    1,774
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پچ
    پچ مورد علاقه
    پسندیده : 725
    مورد پسند : 1,164 بار در 582 پست
    سیستم عامل و مرورگر:
    همه اررور ها رو بفرست.

  11. #10
    دستاورد ها:
    1 سال ثبت نام شده استبرچسب زن کلاس اول۱۰۰۰ امتیاز

    شماره عضویت
    165
    تاریخ عضویت
    Feb 2015
    نوشته ها
    50
    نسل
    نسل مورد علاقه
    نژاد
    نژاد  مورد علاقه
    کلاس
     کلاس  مورد علاقه
    سورس
     سورس مورد علاقه
    پسندیده : 2
    مورد پسند : 7 بار در 7 پست
    سیستم عامل و مرورگر:
    ولا عرور ها فراموش کردم ولی حالا شما یه باز بینی بکنید ببنید چرا با نسحه اخر ترینیتی عرور میده چون این اسکریپت خیلی خوبه

صفحه 1 از 2 12 آخرینآخرین

کلمات کلیدی این موضوع

مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •