ابزار سرور WoW | World Of WarCraft | Scirpt

ابزار سرور | ابزار WOW | ابزار بازی های انلاین | ابزار گیم سرور ها | رفع مشکلات | رتبه بندی | تبلیغات | اموزش | هک | کتاب های اموزشی | خرید و فروش

ابزار سرور WoW | World Of WarCraft | Scirpt

ابزار سرور | ابزار WOW | ابزار بازی های انلاین | ابزار گیم سرور ها | رفع مشکلات | رتبه بندی | تبلیغات | اموزش | هک | کتاب های اموزشی | خرید و فروش

Multi Vendor (General)


کد PHP:
/*
*******************************
*            I-Script             *
*                              *
*        Packed By Imorate     *
*                              *
*  YID! Mr.Amirooo@Yahoo.Com  *
*                              *
*      Website: IranCore.Ir      *
*******************************
*/

#include "ScriptPCH.h"
#include <cstring>
#include "CustomVendor.h" // upravte si cestu
class vendor_multi : public CreatureScript{
    public:

        
vendor_multi()
            : 
CreatureScript("vendor_multi")
        {
        }

        
bool OnGossipHello(PlayerplayerCreaturecreature)
        {
            
IterateCategory(playercreature);
            return 
true;
        }

        
void IterateCategory(PlayerplayerCreaturecreatureint category 0)
        {
            
player->PlayerTalkClass->ClearMenus();
            
player->currentVendorEntry = -1;
            
VendorEntry *current current CustomVendorMgr.GetParent(category);
            
VendorEntryList *result;
            
            if(
category == 0)
                
result CustomVendorMgr.GetBaseItemsForEntry(creature->GetEntry());
            else
                
result CustomVendorMgr.GetItemsForEntry(creature->GetEntry(), category);
            
VendorEntryList::iterator i;

            
int x 0;
            for (
result->begin(); != result->end(); ++i)
            {
                
VendorEntry *vendorEntry = *i;

                
int icon GOSSIP_ICON_CHAT;
                if(
CustomVendorMgr.GetNext(creature->GetEntry(), vendorEntry->next) < 0)
                    
icon GOSSIP_ICON_MONEY_BAG;

                
player->ADD_GOSSIP_ITEM(iconvendorEntry->descGOSSIP_SENDER_MAINGOSSIP_ACTION_INFO_DEF+2+vendorEntry->next);
                
x++;
                if(
== 5)
                {
                    
player->PlayerTalkClass->SendGossipMenu(11102creature->GetGUID());
                    
0;
                }
            }

            if(
current)
            {
                if(
current->group != 0)
                    
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT"<< back"GOSSIP_SENDER_MAINGOSSIP_ACTION_INFO_DEF+2+current->id);
                else
                    
player->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT"<< back"GOSSIP_SENDER_MAINGOSSIP_ACTION_INFO_DEF+1);
                
x++;
            }

            if(
!= 0)
                
player->PlayerTalkClass->SendGossipMenu(11102creature->GetGUID());
        }

        
bool OnGossipSelect(PlayerplayerCreaturecreatureuint32 /*uiSender*/uint32 uiAction)
        {
            if (
uiAction == GOSSIP_ACTION_INFO_DEF+1)
            {
                
IterateCategory(playercreature);
            }
            else if (
uiAction GOSSIP_ACTION_INFO_DEF+1)
            {
                
int id uiAction-GOSSIP_ACTION_INFO_DEF-2;
                
int next CustomVendorMgr.GetNext(creature->GetEntry(), id);
                if(
next 0)
                {
                    
next = (-1) * next;
                    
player->currentVendorEntry next;
                    
player->GetSession()->SendListInventory(creature->GetGUID(), next);
                }
                else
                    
IterateCategory(playercreatureid);
            }

            return 
true;
        }

};
void AddSC_vendor_multi()
{
    new 
vendor_multi();
}  

منبع : Irancore