[Release]Class Changer Item! menu

User Tag List

Page 1 of 3 123 LastLast
Results 1 to 15 of 38
  1. #1
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Release]Class Changer Item!

    This item will change your class if you use it you can choose wich class you would like to be. Enjoy!

    Code:
    /*
       Class Change Item Script
    	  Made by Azolex
    	  
    	Copyrights (C) Azolex 
    	  
    	www.sunplusplus.info
    	www.aspiredev.org
    	www.bluascripting.net
    	www.mmowned.com
    */
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define CLASS_CHANGE_ITEM 90005
    
    #ifdef WIN32
    #pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    class SCRIPT_DECL Classer : 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 Classer::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
    {
    	GossipMenu * Menu;
    	objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 0, Plr);
    
    
    	Menu->AddItem(0, "I want to be Warrior!", 1);
    	Menu->AddItem(0, "I want to be Paladin!", 2);
    	Menu->AddItem(0, "I want to be Hunter!", 3);
    	Menu->AddItem(0, "I want to be Rouge!", 4);
    	Menu->AddItem(0, "I want to be Priest!", 5);
    	Menu->AddItem(0, "I want to be Death Knight!", 6);
    	Menu->AddItem(0, "I want to be Shaman!", 7);
    	Menu->AddItem(0, "I want to be Mage!", 8);
    	Menu->AddItem(0, "I want to be Warlock!", 9);
    	Menu->AddItem(0, "I want to be Druid!", 11);
    
    	Menu->AddItem(0, "I Don't want to chage class!", 50);
    	if(AutoSend)
    		Menu->SendTo(Plr);
    };
    
    void Classer::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
    	switch(IntId)
    	{
    		case 0:
    		{
    			GossipHello(pObject, Plr, true);
    		}break;
    		case 50:
    		{
    			Plr->Gossip_Complete();
    		}break;
    
    		default:
    		{
    			if (Plr->getClass() != IntId)
    			{
    				Plr->setClass((uint8)IntId);
    				Plr->GetItemInterface()->RemoveItemAmt(CLASS_CHANGE_ITEM, 1);
    				Plr->BroadcastMessage("Class change complete. Relog to see the effect.");
    				Plr->Gossip_Complete();
    			}
    			else if (Plr->getClass() == IntId)
    			{				
    				Plr->BroadcastMessage("ERROR: You are already that class, please choose other class!");
    				Plr->Gossip_Complete();
    			}
    		}break;
    
    	}
    };
    
    void Classer::GossipEnd(Object * pObject, Player* Plr)
    {
    	GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupSurgeon(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new Classer();
    	mgr->register_item_gossip_script(CLASS_CHANGE_ITEM, gs);
    }
    NOTE: There is risk of bugging character after changing classes, spell that he used before changed class will stay there. (I suggest this only for first level's like giving a tauren rouge option or something like that xD

    Code:
    /*
       Class Change Item Script
    	  Made by Azolex
    	  
    	Copyrights (C) Azolex 
    	  
    	www.sunplusplus.info
    	www.aspiredev.org
    	www.bluascripting.net
    	www.mmowned.com
    */
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define CLASS_CHANGE_ITEM 90005
    
    #ifdef WIN32
    #pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    class SCRIPT_DECL Classer : 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 Classer::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
    {
    	GossipMenu * Menu;
    	objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 0, Plr);
    
    
    	Menu->AddItem(0, "I want to be Warrior!", 1);
    	Menu->AddItem(0, "I want to be Paladin!", 2);
    	Menu->AddItem(0, "I want to be Hunter!", 3);
    	Menu->AddItem(0, "I want to be Rouge!", 4);
    	Menu->AddItem(0, "I want to be Priest!", 5);
    	Menu->AddItem(0, "I want to be Death Knight!", 6);
    	Menu->AddItem(0, "I want to be Shaman!", 7);
    	Menu->AddItem(0, "I want to be Mage!", 8);
    	Menu->AddItem(0, "I want to be Warlock!", 9);
    	Menu->AddItem(0, "I want to be Druid!", 11);
    
    	Menu->AddItem(0, "I Don't want to chage class!", 50);
    	if(AutoSend)
    		Menu->SendTo(Plr);
    };
    
    void Classer::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
    	switch(IntId)
    	{
    		case 0:
    		{
    			GossipHello(pObject, Plr, true);
    		}break;
    		case 50:
    		{
    			Plr->Gossip_Complete();
    		}break;
    
    		default:
    		{
    			if (Plr->getClass() != IntId)
    			{
    				Plr->setClass((uint8)IntId);
    				Plr->Reset_Spells();
    				Plr->GetItemInterface()->RemoveItemAmt(CLASS_CHANGE_ITEM, 1);
    				Plr->BroadcastMessage("Class change complete. Relog to see the effect.");
    				Plr->Gossip_Complete();
    			}
    			else if (Plr->getClass() == IntId)
    			{				
    				Plr->BroadcastMessage("ERROR: You are already that class, please choose other class!");
    				Plr->Gossip_Complete();
    			}
    		}break;
    
    	}
    };
    
    void Classer::GossipEnd(Object * pObject, Player* Plr)
    {
    	GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupClasser(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new Classer();
    	mgr->register_item_gossip_script(CLASS_CHANGE_ITEM, gs);
    }
    EDIT: Added script that will wipe almost every player spell, that is not tested in this case, but it should work.

    Hearthstone/Ascent Shared Pointer version:
    Code:
    /*
       Class Change Item Script
    	  Made by Azolex
    	  
    	Copyrights (C) Azolex 
    	  
    	www.sunplusplus.info
    	www.aspiredev.org
    	www.bluascripting.net
    	www.mmowned.com
    */
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define CLASS_CHANGE_ITEM 90005
    
    #ifdef WIN32
    #pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    class SCRIPT_DECL Classer : public GossipScript
    {
    public:
    	void GossipHello(shared_ptr<Object> pObject, shared_ptr<Player> Plr, bool AutoSend);
    	void GossipSelectOption(shared_ptr<Object> pObject, shared_ptr<Player> Plr, uint32 Id, uint32 IntId, const char * Code);
    	void GossipEnd(shared_ptr<Object> pObject, shared_ptr<Player> Plr);
    	void Destroy()
    	{
    		delete this;
    	}
    };
    
    void Classer::GossipHello(shared_ptr<Object> pObject, shared_ptr<Player> Plr, bool AutoSend)
    {
    	GossipMenu * Menu;
    	objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 0, Plr);
    
    
    	Menu->AddItem(0, "I want to be Warrior!", 1);
    	Menu->AddItem(0, "I want to be Paladin!", 2);
    	Menu->AddItem(0, "I want to be Hunter!", 3);
    	Menu->AddItem(0, "I want to be Rouge!", 4);
    	Menu->AddItem(0, "I want to be Priest!", 5);
    	Menu->AddItem(0, "I want to be Death Knight!", 6);
    	Menu->AddItem(0, "I want to be Shaman!", 7);
    	Menu->AddItem(0, "I want to be Mage!", 8);
    	Menu->AddItem(0, "I want to be Warlock!", 9);
    	Menu->AddItem(0, "I want to be Druid!", 11);
    	Menu->AddItem(0, "I Don't want to chage class!", 50);
    	
    	if(AutoSend)
    		Menu->SendTo(Plr);
    };
    
    void Classer::GossipSelectOption(shared_ptr<Object> pObject, shared_ptr<Player> Plr, uint32 Id, uint32 IntId, const char * Code)
    {
    	switch(IntId)
    	{
    		case 0:
    		{
    			GossipHello(pObject, Plr, true);
    		}break;
    		case 50:
    		{
    			Plr->Gossip_Complete();
    		}break;
    
    		default:
    		{
    			if (Plr->getClass() != IntId)
    			{
    				Plr->setClass((uint8)IntId);
    				Plr->Reset_Spells();
    				Plr->GetItemInterface()->RemoveItemAmt(CLASS_CHANGE_ITEM, 1);
    				Plr->BroadcastMessage("Class change complete. Relog to see the effect.");
    				Plr->Gossip_Complete();
    			}
    			else if (Plr->getClass() == IntId)
    			{				
    				Plr->BroadcastMessage("ERROR: You are already that class, please choose other class!");
    				Plr->Gossip_Complete();
    			}
    		}break;
    
    	}
    };
    
    void Classer::GossipEnd(shared_ptr<Object> pObject, shared_ptr<Player> Plr)
    {
    	GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupClasser(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new Classer();
    	mgr->register_item_gossip_script(CLASS_CHANGE_ITEM, gs);
    }
    Last edited by AzolexX; 01-20-2009 at 11:17 AM.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

    [Release]Class Changer Item!
  2. #2
    svedin's Avatar Contributor
    Reputation
    124
    Join Date
    Jun 2008
    Posts
    557
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Dam thats nice ^^'

    +Rep

  3. #3
    Performer's Avatar Contributor
    Reputation
    212
    Join Date
    Nov 2007
    Posts
    874
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice
    Fillah


  4. #4
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Honestly now... [CPlusPlus] is not a valid thread tag.

    Also, you should probably add a note saying this does not remove or add any spells, so it will bug your character.
    Life Puzzler WoW - Website | Forums

  5. #5
    Nymphx's Avatar Active Member
    Reputation
    83
    Join Date
    Sep 2008
    Posts
    212
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice script, +Rep, but wouldn't this be alittle over-used on some servers? A paladin that changes class to a priest may be able to kepe his plate armor on...

  6. #6
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Gastricpenguin i was thinking of remove all spells, but could not find function for it i only found for UnlearnSpell (ID), any function you can suggest?

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  7. #7
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Impressive script, much better than all these repacks and Lua scripts that have been popping up.

    +Rep for sure

  8. #8
    Illegalpie's Avatar Member
    Reputation
    11
    Join Date
    Jul 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ID? Pleaseee
    Offering Powerleveling 1$perlevel Aim me Zackattack7230

  9. #9
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Illegalpie: #define CLASS_CHANGE_ITEM 90005
    Added experimental script with spell wiping on change class i think it works, but tbh *Use at own Risc!* .

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  10. #10
    Illegalpie's Avatar Member
    Reputation
    11
    Join Date
    Jul 2008
    Posts
    240
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    [Err] 1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'class SCRIPT_DECL Classer : public GossipScript
    {
    public:
    void GossipHello(O' at line 10
    [Err] #include "StdAfx.h"
    #include "Setup.h"

    #define CLASS_CHANGE_ITEM 90005

    #ifdef WIN32
    #pragma warning(disable:4305) // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif

    class SCRIPT_DECL Classer : public GossipScript
    {
    public:
    void GossipHello(Object * pObject, Player* Plr, bool AutoSend);
    [Msg] Finished - Unsuccessfully
    --------------------------------------------------
    Offering Powerleveling 1$perlevel Aim me Zackattack7230

  11. #11
    Vindicated's Avatar Contributor
    Reputation
    226
    Join Date
    Aug 2008
    Posts
    1,067
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You don't execute the script into your database :P

    You compile it. Here's how:
    http://www.mmowned.com/forums/emulat...dll-video.html


  12. #12
    Choices's Avatar Member
    Reputation
    94
    Join Date
    Apr 2008
    Posts
    231
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Illegalpie you made my day :P

  13. #13
    Nivelo's Avatar Member
    Reputation
    10
    Join Date
    Jan 2007
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Neato azolex, just make those spells swap too and it'll be widely used around here ;-)

  14. #14
    AzolexX's Avatar Contributor
    Reputation
    179
    Join Date
    May 2007
    Posts
    587
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Yeah, but that needs time xD. If i get some free time i might do it.

    Find about scripting, programming and music! My blog: https://worldofsmth.wordpress.com!

  15. #15
    Succy's Avatar Banned
    Reputation
    40
    Join Date
    Jun 2007
    Posts
    804
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ouch! Nice! Looks awesome Good Job!

Page 1 of 3 123 LastLast

Similar Threads

  1. [Release] Class Changer NPC - C++
    By LaAevie in forum WoW EMU General Releases
    Replies: 32
    Last Post: 07-31-2009, 03:10 AM
  2. [release]Token to item exchanger, for tier 7, 8, 9
    By jokerjokes in forum World of Warcraft Emulator Servers
    Replies: 50
    Last Post: 01-30-2008, 02:50 PM
  3. [Release] 2 Custom Items
    By Festigio in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 01-27-2008, 12:41 AM
  4. [Release] Portable Multifuncional Item (test)
    By Spartansp in forum World of Warcraft Emulator Servers
    Replies: 22
    Last Post: 01-15-2008, 03:03 PM
  5. [Release] Realmlist Changer
    By SiPex in forum WoW EMU Programs
    Replies: 16
    Last Post: 10-28-2007, 03:11 AM
All times are GMT -5. The time now is 06:59 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