[2nd Place] Mounter Script! menu

User Tag List

Results 1 to 11 of 11
  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)

    [2nd Place] Mounter Script!

    This is my C++ 2nd place entry. Originaly it had SpellHandler that did not work...so it will be just this.

    NOTE: After i uploaded my files to rapidshare, few days later, i wiped my Hard Drive since PC was broken. I have lost both scripts, but after few days i remembered my old workshop svn hosted on Google Code, i found out that i commited this Mounter script, but for Zombie event script i would need Emulation Contest heads(Hellgawd,2d and Gastric) to post it .


    You can use custom display ID's in it. Id of item is 60000 and you can edit it and display id of mount is 23647 you can also edit it for any, i repeat any display ID you want . Say hello to Illidan Mounts and enjoy!
    Code:
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define STONEID 60000
    #define MOUNTDISPLAYID 23647
    
    class SCRIPT_DECL MountStone : 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 MountStone::GossipHello(Object* pObject, Player * Plr, bool AutoSend)
    {
    	if(Plr->CombatStatus.IsInCombat())
    	{
    		Plr->BroadcastMessage("You cannot mount in combat!");
    		return; 
    	}
    
    	GossipMenu *Menu;
    	objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), 2593, Plr);
    
    	Menu->AddItem(0, "Mount me up Baybe!", 1);
    	Menu->AddItem(0, "Dismount me Baybe!", 2);
    
    	if(AutoSend)
    		Menu->SendTo(Plr);
    }
    
    void MountStone::GossipSelectOption(Object* pObject, Player* Plr, uint32 Id, uint32 IntId, const char * Code)
    {
        GossipMenu * Menu;
        switch(IntId) 
    	{
    	    case 1:
    		{
                plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, MOUNTDISPLAYID);
    			plr->CastSpell(plr, 27879, true);
    		}break;
    	
    		case 2:
    		{
                plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
    			plr->RemoveAura( 27879 );
    		}break;
    	}
    	
    	Plr->Gossip_Complete();
    }
    void MountStone::GossipEnd(Object * pObject, Player* Plr)
    {
    	GossipScript::GossipEnd(pObject, Plr);
    }
    
    void SetupMountStone(ScriptMgr * mgr)
    {
    	GossipScript * gs = (GossipScript*) new MountStone();
    	mgr->register_item_gossip_script(STONEID, gs);
    }
    Last edited by AzolexX; 01-21-2009 at 01:54 PM.

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

    [2nd Place] Mounter Script!
  2. #2
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Screenshots?

  3. #3
    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)
    Hm screenshots for mount? You can use any display id's!

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

  4. #4
    Lilltimmy's Avatar Member
    Reputation
    20
    Join Date
    Jun 2007
    Posts
    275
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Kk nice

    +Rep x2.

  5. #5
    Darksid's Avatar Member
    Reputation
    19
    Join Date
    Jun 2008
    Posts
    375
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    epic release +rep. Idk what im gonna use for a mount maybe one of those two headed dogs lol

  6. #6
    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)
    Didn't ACDB release this script like 2 years ago? I'm pretty sure they did. Did you modify it or is this completely different?

    +Rep though nice script

    EDIT - gotta spread
    Last edited by Vindicated; 01-21-2009 at 05:28 PM.


  7. #7
    Sebastian011's Avatar Member
    Reputation
    22
    Join Date
    Jan 2009
    Posts
    112
    Thanks G/R
    0/1
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How do i set the NPC ID?

  8. #8
    Clain's Avatar Banned
    Reputation
    179
    Join Date
    Jan 2008
    Posts
    1,396
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It isn't an NPC, its an item. The ID of the item is 60000, but you can change it to whatever you like.
    #define STONEID 60000

  9. #9
    *~Descending~*'s Avatar Member
    Reputation
    25
    Join Date
    Sep 2008
    Posts
    71
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
    plr->RemoveAura( 27879 );
    UNIT_FIELD_MOUNTDISPLAYID removes the aura, not set the speed back to normal. So really you're removing the aura twice (Correct me if i'm wrong).
    So you actually have to take a look at some packets and use playersetspeed to dismount the player.

  10. #10
    kaato's Avatar Member
    Reputation
    12
    Join Date
    Dec 2007
    Posts
    95
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice

    gotta try this ^^

  11. #11
    tekkeryole's Avatar Member
    Reputation
    23
    Join Date
    Jul 2008
    Posts
    34
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here is a safer way to script the flying mount -

    I scripted this for World X Productions over 6 months ago, and committed to AUDB's SVN with some other customs not too long ago.

    The code still needs to be cleaned up:
    On item use, when you right click this item to open the gossip menu, this removes any flying, speed & mount display you currently have on.
    Cannot use in combat
    Cannot mount unless you are in Azeroth, Northrend, Outlands or Kalimdor. Instances or any other map ID will give you the - You can't use that here - error.

    This is ONLY compatible with Aspire HearthStone. There are some modifications that need to be made to convert for Arc Emu and Mangos, but those are simple edits.
    Code:
    //This Script is written by WHOS and TRONYC
    //Credits go to Original Authors of the following:
    //MounterNPC.CPP - ODIN//Scarface
    //Mounter.CPP - ACDB SVN
    
    
    //  Each Mount automatically disables flying and resets speed back to normal
    //  Set up for funserver, so they give a +1 speed boost, if you want the speeds
    //  Blizz Like just mod it as you wish. - 7 is normal run speed
    #include "StdAfx.h"
    #include "Setup.h"
    
    #ifdef WIN32
    #pragma warning(disable:4305)        // warning C4305: 'argument' : truncation from 'double' to 'float'
    #endif
    
    #define MOUNTER_ITEM_ID 70002 // Item ID
    #define MOUNTER_TEXT_ID 2593
    
    class SCRIPT_DECL ExoticMount : public GossipScript{
      public:
        void GossipHello(ObjectPointer pObject, PlayerPointer Plr, bool AutoSend);
        void GossipSelectOption(ObjectPointer pObject, PlayerPointer Plr, uint32 Id, uint32 IntId, const char * Code);
        void GossipEnd(ObjectPointer pObject, PlayerPointer Plr){ GossipScript::GossipEnd(pObject, Plr); }
        void Destroy(){ delete this; }
    };
    
    void ExoticMount::GossipHello(ObjectPointer pObject, PlayerPointer Plr, bool AutoSend){
      bool flytf = false; 
      uint32 eventid = 5;
    
      WorldPacket fly(SMSG_MOVE_UNSET_CAN_FLY, 13);
      Plr->m_setflycheat = flytf;
      fly << Plr->GetNewGUID();
      fly << uint32(eventid);
      Plr->SendMessageToSet(&fly, true);
      Plr->SetPlayerSpeed(RUN,     8);
      Plr->SetPlayerSpeed(SWIM,    6);
      Plr->SetPlayerSpeed(RUNBACK, 4);
      Plr->SetPlayerSpeed(FLY,     12);
      Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, 0);
    
      Plr->Gossip_Complete();
    
      if(Plr->CombatStatus.IsInCombat()){
        Plr->BroadcastMessage("You are in combat!");
    
    
      }else{
        GossipMenu *Menu;
        objmgr.CreateGossipMenuForPlayer(&Menu, pObject->GetGUID(), MOUNTER_TEXT_ID, Plr);
        Menu->AddItem(0, "Da Plane Boss!", 1);
        Menu->AddItem(0, "Orange Flying Carpet", 2);
    	Menu->AddItem(2, "Nevermind", 3);
        if(AutoSend) Menu->SendTo(Plr);
      }
    };
    
    void ExoticMount::GossipSelectOption(ObjectPointer pObject, PlayerPointer Plr, uint32 Id, uint32 IntId, const char * Code){
      switch(IntId){
        case 1:{
          if(Plr->getLevel() >= 100){
     if(Plr->GetMapId() != 0 && Plr->GetMapId() != 1 && Plr->GetMapId() != 530 && Plr->GetMapId() != 571)
     {
        Plr->BroadcastMessage("You can't use that here!");
                 return;
     }
          bool flytf = true; 
    	  uint32 eventid = 2; 
    	  uint32 displayid = 26556;  // Display ID
    
    	  WorldPacket fly(SMSG_MOVE_SET_CAN_FLY, 13);
          Plr->m_setflycheat = true;
          fly << Plr->GetNewGUID();
          fly << uint32(eventid);
          Plr->SendMessageToSet(&fly, true);
          Plr->SetPlayerSpeed(RUN,     12);
          Plr->SetPlayerSpeed(SWIM,    7);
          Plr->SetPlayerSpeed(RUNBACK, 7);
          Plr->SetPlayerSpeed(FLY,     25);
          Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayid);
    	  Plr->Gossip_Complete();
          }else {
            Plr->BroadcastMessage("You Must be level 100 to use this mount!"); 
          }break;
        }
        case 2:{
          if(Plr->getLevel() >= 100){
     if(Plr->GetMapId() != 0 && Plr->GetMapId() != 1 && Plr->GetMapId() != 530 && Plr->GetMapId() != 571)
     {
        Plr->BroadcastMessage("You can't use that here!");
                 return;
     }
    	  bool flytf = true; 
    	  uint32 eventid = 2; 
    	  uint32 displayid = 28060;  // Display ID
          
          WorldPacket fly(SMSG_MOVE_SET_CAN_FLY, 13);
          Plr->m_setflycheat = true;
          fly << Plr->GetNewGUID();
          fly << uint32(eventid);
          Plr->SendMessageToSet(&fly, true);
          Plr->SetPlayerSpeed(RUN,     12);
          Plr->SetPlayerSpeed(SWIM,    7);
          Plr->SetPlayerSpeed(RUNBACK, 7);
          Plr->SetPlayerSpeed(FLY,     25);
          Plr->SetUInt32Value(UNIT_FIELD_MOUNTDISPLAYID, displayid);
    	  Plr->Gossip_Complete();
          }else {
            Plr->BroadcastMessage("You Must be level 100 to use this mount!"); 
          }break;
        }
    	case 3:{
    	  Plr->Gossip_Complete();
        }
      }
    }
    void SetupExoticMount(ScriptMgr *mgr){
      GossipScript * gs = (GossipScript*) new ExoticMount();
      mgr->register_item_gossip_script(MOUNTER_ITEM_ID, gs);
    }

Similar Threads

  1. Replies: 0
    Last Post: 09-27-2016, 05:21 AM
  2. How to detect a Lua script permission-checking place
    By alex-mech in forum World of Warcraft General
    Replies: 2
    Last Post: 12-04-2014, 04:28 AM
  3. [Areachange] Crystalsong Mountains - 2nd place in the Model Editing contest
    By Warlock in Space in forum WoW Advanced Model Edits
    Replies: 16
    Last Post: 11-26-2013, 10:44 AM
  4. A Few Places for Gold Farming
    By Matt in forum World of Warcraft Guides
    Replies: 1
    Last Post: 11-02-2006, 06:52 PM
All times are GMT -5. The time now is 05:51 AM. 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