Guild House Teleporter menu

Shout-Out

User Tag List

Results 1 to 1 of 1
  1. #1
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Guild House Teleporter

    Simple guild house teleport NPC and Item script.

    Talk to the NPC / Item, and you get the option to teleport to your guild house (if you have one).

    Guild house is any location in the world.

    To add a guild house, edit the database.



    Here's the SQL to add the guild house table:
    Code:
     CREATE TABLE guild_houses ( `guildid` bigint(20) NOT NULL,
     `mapId` int(8) unsigned NOT NULL default '0',
     `posx` float NOT NULL,
     `posy` float NOT NULL,
     `posz` float NOT NULL,
     `poso` float NOT NULL,
     PRIMARY KEY  (`guildId`),
     UNIQUE KEY `guildId` (`guildId`)

    And here's the script.

    Code:
    //Simple Guild House Teleporter
    //Made By Jotox/Classic
    
    
    //REPLACE THIS WITH YOUR GUILD TELEPORT NPC ID. (0 for no npc)
    #define NPC_ID 9999999
    
    //REPLACE THIS WITH YOUR ITEM TELEPORTER ID. (0 for no item)
    #define ITEM_ID 9999999
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    static string MSG_RED = "|CFFFF0000";
    
    void GuildTeleport( Player* plr)
    {
    	if( !plr->isAlive() || plr->CombatStatus.IsInCombat() )
    	{
    		plr->BroadcastMessage("%sYou cannot perform this action while %s.", MSG_RED, (plr->isAlive()) ?  "in combat." : "dead." );
    		return;
    	}
    	if( !plr->IsInGuild() )
    	{
    		plr->BroadcastMessage("%sYou must be in a guild to use this.", MSG_RED);
    		return;
    	}
    	QueryResult *result = CharacterDatabase.Query("SELECT * FROM `guild_houses` WHERE guildid = '%u'", plr->GetGuildId() );
    	if( !result )
    	{
    		plr->BroadcastMessage("%sYour guild does not have a guild house.", MSG_RED);
    		return;
    	}
    	Field *fields = result->Fetch();
    	uint32 map = fields[1].GetUInt32();
    	float x = fields[2].GetFloat();
    	float y = fields[3].GetFloat();
    	float z = fields[4].GetFloat();
    	float o = fields[5].GetFloat();
    	
    	plr->SafeTeleport( map , 0, x, y, z, o)
    	
    	delete result;
    }
    
    class SCRIPT_DECL GuildTeleport : public GossipScript
    {
    public:
        void GossipHello(Object * pObject, Player * plr, bool AutoSend)
        {
    		
    		{
    			GossipMenu *Menu;
    			objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 0, plr);
    			Menu->AddItem( 0, "Teleport Me To My Guild House!", 1);
    			if(AutoSend)
    				Menu->SendTo(plr);
    		}
    		else
    		{
    			plr->BroadcastMessage("You must be in a guild to use this.");
    		}
        }
    	
        void GossipSelectOption(Object * pObject, Player * plr, uint32 Id, uint32 IntId, const char * Code)
        {
    		plr->Gossip_Complete();
    		GuildTeleport( plr );
    	}
    	
    	void GossipEnd(Object * pObject, Player* Plr)
    	{
    		GossipScript::GossipEnd(pObject, Plr);
    	}
    	
        void Destroy()
        {
            delete this;
        }
    };
    
    void SetupGuildTeleporter(ScriptMgr * mgr)
    {	
    	GossipScript* gs = (GossipScript*) new GuildTeleport();
    	if( NPC_ID > 0 )
    		mgr->register_gossip_script(NPC_ID, gs );	
    	if( ITEM_ID > 0 )
    		mgr->register_item_gossip_script(ITEM_ID, gs );
    }
    
    /*
     CREATE TABLE guild_houses ( `guildid` bigint(20) NOT NULL,
     `mapId` int(8) unsigned NOT NULL default '0',
     `posx` float NOT NULL,
     `posy` float NOT NULL,
     `posz` float NOT NULL,
     `poso` float NOT NULL,
     PRIMARY KEY  (`guildId`),
     UNIQUE KEY `guildId` (`guildId`)
     )*/

    Guild House Teleporter

Similar Threads

  1. [Release] Guild Housing Item + SQL
    By scott07 in forum World of Warcraft Emulator Servers
    Replies: 38
    Last Post: 06-08-2008, 01:23 PM
  2. None's 2.4 Repack With Guild Houses Rev 4324
    By Nonenone in forum World of Warcraft Emulator Servers
    Replies: 2
    Last Post: 04-16-2008, 09:55 PM
  3. [Release] Guild House's Some What!
    By Gamkie in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 03-30-2008, 01:14 PM
  4. Guild Houses?
    By y2kss66 in forum World of Warcraft Emulator Servers
    Replies: 10
    Last Post: 03-27-2008, 10:46 AM
  5. How does Player/Guild Housing Work?
    By mafiaboy in forum World of Warcraft Emulator Servers
    Replies: 23
    Last Post: 02-08-2008, 01:32 AM
All times are GMT -5. The time now is 08:56 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