C++ Max Skill NPC menu

User Tag List

Results 1 to 2 of 2
  1. #1
    fokui's Avatar Member
    Reputation
    5
    Join Date
    May 2008
    Posts
    25
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C++ Max Skill NPC

    Hey everyone I saw a request for this so I thought I would post it up. I wrote it up kinda quick should work fine though :O.

    Credits = Me, fokui

    MaxSkill.cpp
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)// warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    
    class SCRIPT_DECL MaxSkill : public GossipScript
    {
    public:
        void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
        void GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code);
        void GossipEnd(Object * pObject, Player* Plr);
    	void Destroy()
    	{
    		delete this;
    	}
    };
    void MaxSkill::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
        {
            GossipMenu *Menu;
            objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    		{
    		Menu->AddItem(9, "Advance All Weapon Skills", 1);
    		}
    		if(AutoSend)
                Menu->SendTo(Plr);
        }
    
    void MaxSkill::GossipSelectOption(Object * pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
        {
    	Creature * pCreature = (pObject->GetTypeId()==TYPEID_UNIT)?((Creature*)pObject):NULL;
    	if(pCreature==NULL)
    		return;
    
            GossipMenu * Menu;
            switch(IntId)
            {
            case 0:
    		GossipHello(pObject, Plr, true);
            break;
    				case 1: // Advance Weapon Skills
    		{
    		if (Plr->_HasSkillLine(43))
    			{Plr->_AdvanceSkillLine(43, 375);}
    		if (Plr->_HasSkillLine(55))
    			{Plr->_AdvanceSkillLine(55, 375);}
    		if (Plr->_HasSkillLine(44))
    			{Plr->_AdvanceSkillLine(44, 375);}
    		if (Plr->_HasSkillLine(95))
    			{Plr->_AdvanceSkillLine(95, 375);}
    		if (Plr->_HasSkillLine(54))
    			{Plr->_AdvanceSkillLine(54, 375);}
    		if (Plr->_HasSkillLine(45))
    			{Plr->_AdvanceSkillLine(45, 375);}
    		if (Plr->_HasSkillLine(46))
    			{Plr->_AdvanceSkillLine(46, 375);}
    		if (Plr->_HasSkillLine(136))
    			{Plr->_AdvanceSkillLine(136, 375);}
    		if (Plr->_HasSkillLine(160))
    			{Plr->_AdvanceSkillLine(160, 375);}
    		if (Plr->_HasSkillLine(162))
    			{Plr->_AdvanceSkillLine(162, 375);}
    		if (Plr->_HasSkillLine(172))
    			{Plr->_AdvanceSkillLine(172, 375);}
    		if (Plr->_HasSkillLine(173))
    			{Plr->_AdvanceSkillLine(173, 375);}
    		if (Plr->_HasSkillLine(176))
    			{Plr->_AdvanceSkillLine(176, 375);}
    		if (Plr->_HasSkillLine(226))
    			{Plr->_AdvanceSkillLine(226, 375);}
    		if (Plr->_HasSkillLine(228))
    			{Plr->_AdvanceSkillLine(228, 375);}
    		if (Plr->_HasSkillLine(229))
    			{Plr->_AdvanceSkillLine(229, 375);}
    		if (Plr->_HasSkillLine(473))
    			{Plr->_AdvanceSkillLine(473, 375);}
    			Plr->BroadcastMessage("Weapon skills advanced,Enjoy being lazy!");
    			Plr->Gossip_Complete();
    			}
     }
     }
    
    void MaxSkill::GossipEnd(Object * pObject, Player* Plr)
    {
        GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupMaxSkill(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new MaxSkill();
        mgr->register_gossip_script(NPCID, gs);//Make sure to add your NPCID!!
    }

    Setup.cpp
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    #define SKIP_ALLOCATOR_SHARING 1
    #include <ScriptSetup.h>
    
    extern "C" SCRIPT_DECL uint32 _exp_get_script_type()
    {
    	return SCRIPT_TYPE_MISC;
    }
    
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
    SetupMaxSkill(mgr);
    }
    
    #ifdef WIN32
    
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
    
    #endif

    Setup.h
    Code:
    #ifndef INSTANCE_SCRIPTS_SETUP_H
    #define INSTANCE_SCRIPTS_SETUP_H
    
    void SetupMaxSkill(ScriptMgr * mgr);
    
    
    #endif

    C++ Max Skill NPC
  2. #2
    bettyb00p's Avatar Member
    Reputation
    14
    Join Date
    Jun 2008
    Posts
    34
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How would I go about setting this up with my server?

Similar Threads

  1. max skill npc
    By denisz11 in forum WoW EMU Questions & Requests
    Replies: 6
    Last Post: 09-28-2008, 07:36 PM
  2. [Release] Skill Npc 2.0
    By Sylex in forum World of Warcraft Emulator Servers
    Replies: 30
    Last Post: 06-02-2008, 05:02 PM
  3. How to make players get max skill in weps??
    By Froddy in forum World of Warcraft Emulator Servers
    Replies: 1
    Last Post: 03-27-2008, 04:22 PM
  4. [Release] Skill Npc - Revived
    By Sylex in forum World of Warcraft Emulator Servers
    Replies: 38
    Last Post: 02-29-2008, 02:31 PM
  5. [Release] Chirspee's Teleporting NPC, Buff NPC's, Skill NPC and Heal NPC
    By Illidan1 in forum World of Warcraft Emulator Servers
    Replies: 13
    Last Post: 11-22-2007, 04:05 PM
All times are GMT -5. The time now is 11:13 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2024 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search