My reply is not wasted menu

User Tag List

Results 1 to 1 of 1
  1. #1
    hax0rz's Avatar Member
    Reputation
    5
    Join Date
    Aug 2007
    Posts
    40
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    My reply is not wasted

    I was just gonna reply to http://www.mmowned.com/forums/emulat...ml#post1088519 and it says more than 132 days old well screw that i just figured this out today! and here is the response i was gonna put.

    I might as well do something while Im here....

    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 Prof : 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 Prof::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Menu->AddItem(7, "Welcome to the Profession Pig, click to learn then go to a trainer", 5);
    Menu->AddItem(8, "Enchanting", 96);
    Menu->AddItem(8, "Tailoring", 95);
    Menu->AddItem(8, "Engineering", 94);
    Menu->AddItem(8, "Jewelcrafting", 93);
    Menu->AddItem(8, "Alchemy", 92);
    Menu->AddItem(8, "Black smith", 91);
    Menu->AddItem(8, "Herbalism", 90);
    Menu->AddItem(8, "Leather working", 89);
    Menu->AddItem(8, "Mining", 88);
    Menu->AddItem(8, "Inscription", 87);
    Menu->AddItem(8, "Cooking", 86);
    Menu->AddItem(8, "First aid", 85);
    Menu->AddItem(8, "Fishing", 84);
    Menu->AddItem(5, "Set my Profession skills to 450", 50);
    if(AutoSend)
    Menu->SendTo(Plr);
    }
    void Prof::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)
    {
    //Return to start
    case 0:     
    GossipHello(pObject, Plr, true);
    break;
          
    
    
    
    case 96: // Enchanting
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51312, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Enchanting learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    case 95: // Tailoring
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51308, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Tailoring learned" );
    
    Menu->SendTo(Plr);
    }break;
    case 94: // Engineering
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51305, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Engineering learned" );
    
    Menu->SendTo(Plr);
    }break;
    case 93: // Jewelcrafting
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51310, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Jewelcrafting learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    case 92: // Alchemy
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51303, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Alchemy learned" );
    
    Menu->SendTo(Plr);
    }break;
    case 91: // Blacksmith
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51298, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Blacksmithing learned" );
    
    Menu->SendTo(Plr);
    }break;
    case 90: //Herbalism
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 50301, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Herbalism learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    case 89: // Leatherworking
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51301, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Leatherworking learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    case 88: // Mining
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 50309, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Mining learned" );
    
    Menu->SendTo(Plr);
    }break;
    case 87: // Inscription
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 45380, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Inscription learned" );
    
    Menu->SendTo(Plr);
    }break;
    case 86: //Cooking
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51295, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Cooking learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    case 85: //First aid
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 50299, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "First aid learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    case 84: //Fishing
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    pCreature->CastSpell(Plr, 51293, 0);
    pCreature->SendChatMessage(CHAT_MSG_MONSTER_SAY, LANG_UNIVERSAL, "Fishing learned" );
    
    Menu->SendTo(Plr);
    }break;
    
    
    
    
    
    
    case 50: //Advance all skills
    {
    {Plr->_AdvanceSkillLine(333, 450);}
    {Plr->_AdvanceSkillLine(197, 450);}
    {Plr->_AdvanceSkillLine(202, 450);}
    {Plr->_AdvanceSkillLine(755, 450);}
    {Plr->_AdvanceSkillLine(171, 450);}
    {Plr->_AdvanceSkillLine(164, 450);}
    {Plr->_AdvanceSkillLine(182, 450);}
    {Plr->_AdvanceSkillLine(165, 450);}
    {Plr->_AdvanceSkillLine(186, 450);}
    {Plr->_AdvanceSkillLine(773, 450);}
    {Plr->_AdvanceSkillLine(185, 450);}
    {Plr->_AdvanceSkillLine(129, 450);}
    {Plr->_AdvanceSkillLine(356, 450);}
    Plr->Gossip_Complete();
    }break;
    
    
    
    
    
    
    
    
    
    case 99: //main menu
    {
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Menu->AddItem(7, "Welcome to the Profession Pig, click to learn then go to a trainer", 5);
    Menu->AddItem(8, "Enchanting", 96);
    Menu->AddItem(8, "Tailoring", 95);
    Menu->AddItem(8, "Engineering", 94);
    Menu->AddItem(8, "Jewelcrafting", 93);
    Menu->AddItem(8, "Alchemy", 92);
    Menu->AddItem(8, "Black smith", 91);
    Menu->AddItem(8, "Herbalism", 90);
    Menu->AddItem(8, "Leather Working", 89);
    Menu->AddItem(8, "Mining", 88);
    Menu->AddItem(8, "Inscription", 87);
    Menu->AddItem(8, "Cooking", 86);
    Menu->AddItem(8, "First aid", 85);
    Menu->AddItem(8, "Fishing", 84);
    Menu->AddItem(5, "Set my Profession skills to 450", 50);
    Plr->Gossip_Complete();
    }break;
    
    
    
    
    
    }
    }
    void Prof::GossipEnd(Object * pObject, Player* Plr)
    {
    GossipScript::GossipEnd(pObject, Plr);
    }
    void SetupProf(ScriptMgr * mgr)
    {
    GossipScript * gs = (GossipScript*) new Prof();
    mgr->register_gossip_script(40001, gs);
    }
    That works, I fixed spelling and stuff put spaces in the const char...thx for this btw I dont even know c++ and I fixed it for my serv :P so why not help everyone who needs.

    I renamed all the skillnpc to prof and put it in my prof folder when compiling a dll...in the scripts/src/scripts folder.

    And then it worked lol

    My reply is not wasted

Similar Threads

  1. Replies: 0
    Last Post: 03-05-2011, 03:06 AM
All times are GMT -5. The time now is 01:27 AM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search