Next Generation Helper NPC menu

Shout-Out

User Tag List

Results 1 to 13 of 13
  1. #1
    jmulhern345's Avatar Banned
    Reputation
    93
    Join Date
    Mar 2008
    Posts
    165
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Next Generation Helper NPC

    One Single Stupid Menu
    NEXT GENERATION HELPER NPC



    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)   
    #endif
    
    class SCRIPT_DECL NPC : 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 mLoadItemsFromDatabase(QueryResult * result);
    };
    void NPC::GossipHello(Object * pObject, Player* Plr, bool AutoSend)
    {
    GossipMenu *Menu;
    objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    Menu->AddItem(4, "DeMorph", 7);
    Menu->AddItem(4, "Teleport", 1);
    Menu->AddItem(4, "Morph", 2);
    Menu->AddItem(4, "Gear", 3);
    Menu->AddItem(4, "Player Port", 9);
    Menu->AddItem(4, "Reset Talents", 8);
    Menu->SendTo(Plr);
    }
    void NPC::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 2:
    		{
    			char Morph[100];
    			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    			sprintf(Morph, "Enter Morph Name [%u]");
    			Menu->AddItem(4, Morph, 4, 1);
    			Menu->SendTo(Plr);
    		}break;
    
    case 4:
    		{
    			QueryResult *Morph = WorldDatabase.Query("Select `DisplayID` FROM player_morphs where `Name` = '%s'", Code); 
    			
    			if(Morph)
    			{
    				Field *Fields = Morph->Fetch();
    				uint32 DisplayID = Fields[0].GetUInt32();
    				Plr->SetUInt32Value(UNIT_FIELD_DISPLAYID, DisplayID);
    			}
    			else
    			Plr->Gossip_Complete();
    		}break;
    
    case 3:
    		{
    			char pItem5[100];
    			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    			sprintf(pItem5, "Enter Item Name [%u]");
    			Menu->AddItem(4, pItem5, 5, 1);
    			Menu->SendTo(Plr);
    		}break;
    
    case 5:
    		{
    QueryResult *pItem5 = WorldDatabase.Query("Select `entryID` FROM Player_items where `Name` = '%s'", Code);
    
    if(pItem5)
    {
    Field *Fields = pItem5->Fetch();
    uint32 entryID = Fields[0].GetUInt32();
    Plr->GetItemInterface()->AddItemToFreeSlot(objmgr.CreateItem(entryID, Plr));
    Plr->Gossip_Complete();
    }
    }break;
    
    		case 1:
    		{
    			char Teleport[225];
    			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    			sprintf(Teleport, "Enter Location Name [%u]");
    			Menu->AddItem(4, Teleport, 6, 1);
    			Menu->SendTo(Plr);
    		}break;
    
       case 6:
    		{
    	     QueryResult *Teleport = WorldDatabase.Query("SELECT * FROM `Player_recall` Where `Name` = '%s'", Code);
    
    
    if(Teleport)
    {
    Field * fields = Teleport->Fetch();
    uint32 MapID = fields[2].GetUInt32();
    float X = fields[3].GetFloat();
    float Y = fields[4].GetFloat();
    float Z = fields[5].GetFloat();
    Plr->EventTeleport(MapID, X, Y, Z);
    Plr->Gossip_Complete();
    		}
    		}break;
    
    case 7:
    {
    Plr->DeMorph();
    }break;
    
    case 8:
    {
    Plr->Reset_Talents();
    }break;
                    case 9:
    		{
    			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 1, Plr);
    			Menu->AddItem(4, "Port Player", 10, 1);
    			Menu->SendTo(Plr);
    		}break;
    case 10:
    {
    			Player * pTarget = objmgr.GetPlayer(Code, false);
    			if(!pTarget)
    			{
    				Plr->BroadcastMessage("Player not found.");
    				Plr->Gossip_Complete();
    				return;
    			}
    			if(pTarget->GetSession()->HasGMPermissions())
    			{
    				Plr->BroadcastMessage("Nice try buddy its a GM.");
    				Plr->Gossip_Complete();
    				return;
    			}
    			uint32 pMap = pTarget->GetMapId();
    			float pX = pTarget->GetPositionX();
    			float pY = pTarget->GetPositionY();
    			float pZ = pTarget->GetPositionZ();
    			float pO = pTarget->GetOrientation();
    			Plr->Gossip_Complete();
    			pTarget->BroadcastMessage("%s is porting to your location.", Plr->GetName());
    			Plr->EventTeleport(pMap, pX, pY, pZ);
    			Plr->SetOrientation(pO);
    		}break;
    
    }
    }
    
    void NPC::GossipEnd(Object * pObject, Player* Plr){
    GossipScript::GossipEnd(pObject, Plr);}
    
    
    void SetupNPC(ScriptMgr * mgr)
    {
       GossipScript * gs = (GossipScript*) new NPC();
        mgr->register_gossip_script(333333, gs);
    }


    What exactly does this mess do?
    (SUMMARY: When you wanna put a new location or a new morph into your CPP teleporter or morpher or whatever....what do you do. RECOMPILE IT /cry.
    You compile this pup once and you execute the SQLS and you just add in new items, Teleports, morphs in through navicat or other SQL database editing
    programs. Before LUA was laughing at VCPP on this forum, since LUA is easly editable and you dont have to compile. Well this just gave LUA backhand and sent it back to the cave were it belongs. Okayer port is not mine i dont know were i got it from. Someone on aspire i think but i liked it so i decided to throw it it. Demorph just Demorphs. Reset Talents is a free obviouus thing. =7)

    Morpher-Type in name of Creature or NPC and you may just become them!
    Well you will if its in the SQL and typed in correctly. Aspire should take most of the Credit for the morpher!! Infact you can actually modify aspire _Morphs and from the aspire Dev SVN so that you can have even more morphs. Or jsut change the source code to match the aspire one :7)

    Gear-Works the same way as the morpher, aspire takes some credit since its based offa the morpher but I deserve some cause i used my Mediocore abilities to make it work for items.

    teleporter-Pulls the coords from the player_recall(in the SQL download) Pst just a modified recall table hehe...and send you there a heck lotta places to go and you can add more very easly. I am thinking about learning how to make custom command scripts so you can add them ingame! MODIFY THE SQL SO PEOPLE CANT GET TO GM ISLAND AND SPECIAL PLACES!


    ENGJOY-Panzershreck
    Last edited by jmulhern345; 03-20-2009 at 09:46 PM. Reason: Add in more of a description.

    Next Generation Helper NPC
  2. #2
    cosminelu16's Avatar Member
    Reputation
    135
    Join Date
    Jul 2008
    Posts
    153
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good +rep

    https://cosmic-top100.com

  3. #3
    jmulhern345's Avatar Banned
    Reputation
    93
    Join Date
    Mar 2008
    Posts
    165
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by cosminelu16 View Post
    good +rep
    Thx for the feed back :7)

  4. #4
    Claiver's Avatar Member
    Reputation
    138
    Join Date
    Mar 2009
    Posts
    217
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Question: "What's the Please Enter Code thingey? What's its purpose?"

  5. #5
    Found's Avatar Banned
    Reputation
    239
    Join Date
    Mar 2009
    Posts
    642
    Thanks G/R
    1/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Now thats pretty cool..

  6. #6
    Confucius's Avatar Super Moderator Don't Look Back in Anger

    CoreCoins Purchaser Authenticator enabled
    Reputation
    1418
    Join Date
    Oct 2007
    Posts
    2,814
    Thanks G/R
    302/311
    Trade Feedback
    7 (100%)
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    +rep for nice release!

  7. #7
    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)
    Massive memory leak script right here.
    Why are you not releasing the queries once they are used?
    Life Puzzler WoW - Website | Forums

  8. #8
    jmulhern345's Avatar Banned
    Reputation
    93
    Join Date
    Mar 2008
    Posts
    165
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Claiver View Post
    Question: "What's the Please Enter Code thingey? What's its purpose?"
    I am guessing that you are looking at the picture. You type in the name of of the morph, teleport, Item, name of player......it will turn you into the thing if you are using the morph function, pLace the item into a free slot in your bags, Teleport you to the location specified or to the player specified.


    AND


    (Massive memory leak script right here.
    Why are you not releasing the queries once they are used?)
    I do not know. I mean are you trying to dig out little ways to insult my script?
    Last edited by jmulhern345; 03-21-2009 at 03:05 PM. Reason: Answer GP's question.

  9. #9
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I mean are you trying to dig out little ways to insult my script?
    I'm pretty sure hes just informing you of a memory leak which needs to be fixed. Idk if your the first C++ coder to like memory leaks or something but mem leaks are bad.

    I live in a shoe

  10. #10
    jmulhern345's Avatar Banned
    Reputation
    93
    Join Date
    Mar 2008
    Posts
    165
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally Posted by Sounddead View Post
    Idk if your the first C++ coder to like memory leaks or something but mem leaks are bad.
    I never said i like them but my script hasn't blown up the world or cauused my server to crsh which is more likly but neither has happened yet you i quite clueless i have never seen a way to prevent memory leaks i looked at other scripts and there were pretty close to mine and you you mind telling me how to to fix it it or are you clue less like me. And just siding with the mod.

  11. #11
    Ghostday's Avatar Active Member
    Reputation
    15
    Join Date
    Feb 2009
    Posts
    63
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice.. but the link is broken for your download, can you tell me how to do it without the download?

  12. #12
    jmulhern345's Avatar Banned
    Reputation
    93
    Join Date
    Mar 2008
    Posts
    165
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Its not broken just click on the text . DOWNLOAD SQL NOW on my code bar in my thread post.

  13. #13
    mako1's Avatar Member
    Reputation
    1
    Join Date
    Jan 2009
    Posts
    35
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cool looks neat

Similar Threads

  1. [Release] Helper Npcs
    By wowcomputer in forum World of Warcraft Emulator Servers
    Replies: 12
    Last Post: 12-25-2007, 05:42 AM
  2. Next Generation Database Project Announcement
    By JulianX in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 10-04-2007, 10:01 PM
  3. [Next Generation Database] Prossess
    By Job For a Cowboy in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 09-30-2007, 11:36 PM
  4. next Generation Repack!
    By Nextgenerationrepack! in forum World of Warcraft Emulator Servers
    Replies: 15
    Last Post: 09-29-2007, 03:13 PM
  5. Next Generation Database Project Announcement
    By JulianX in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 09-25-2007, 11:19 PM
All times are GMT -5. The time now is 03:32 PM. 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