[TrinityCore] ZwowZ, Remove PVP flags from a player npc  (free for you) menu

User Tag List

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

    [TrinityCore] ZwowZ, Remove PVP flags from a player npc (free for you)

    Code:
    //Created by Chronic 
    //of http://ZwowZ.com
    //Enjoy. Feel free to Improve/Include this script on your server.
    //I have provided various functions that are capable of this.
    //
    #define GOSSIP_ITEM_1000       "Remove PVP Flags"
    //#define GOSSIP_ITEM_903       ""
    
    //duh
    //uint32 m_contestedPvPTimer;
    uint32 HasUnitState;
    uint32 ClearUnitState;
    uint32 RemoveByteFlag;
    uint32 uiAction;
    
    
    
    class npc_remove_pvp : public CreatureScript
    {
        public: npc_remove_pvp() : CreatureScript("npc_remove_pvp")
     {
     }
    
                bool OnGossipHello(Player* pPlayer, Creature* pCreature)      
      {
                if (pPlayer->isInCombat())
                {
                pCreature->MonsterWhisper("You Are In Combat!", pPlayer->GetGUID());
                pPlayer->CLOSE_GOSSIP_MENU();
                return true;
            }
            else
            {
                pPlayer->ADD_GOSSIP_ITEM(GOSSIP_ICON_CHAT, GOSSIP_ITEM_1000, GOSSIP_SENDER_MAIN, GOSSIP_ACTION_INFO_DEF+1000); 
                pPlayer->PlayerTalkClass->SendGossipMenu(907, pCreature->GetGUID());
    
                return true;
            }
                //Remove me from pvp
                if (uiAction == GOSSIP_ACTION_INFO_DEF+1000)
                {
                //pPlayer->CastSpell(pPlayer, 20762, true),//Soul Stone
                pPlayer->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_CONTESTED_PVP),
                //m_contestedPvPTimer = 0, // another method I think for contested
                //pPlayer->SetContestedPvPTimer(3), //another method
                pPlayer->RemoveByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP),
                pPlayer->HasByteFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_FFA_PVP),
                //pPlayer->RemoveFlag(UNIT_FIELD_BYTES_2, 1, UNIT_BYTE2_FLAG_PVP),//another method
                pPlayer->HasAuraType(SPELL_AURA_MOD_FACTION),
                pPlayer->RemoveAura(SPELL_AURA_MOD_FACTION),
                pPlayer->HasUnitState(UNIT_STAT_ATTACK_PLAYER),
                pPlayer->ClearUnitState(UNIT_STAT_ATTACK_PLAYER),
                pPlayer->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_PVP_TIMER),
                pPlayer->RemoveFlag(PLAYER_FLAGS, PLAYER_FLAGS_IN_PVP), 
                pPlayer->CLOSE_GOSSIP_MENU();
                }
                
        }
    };
    
    void AddSC_npc_remove_pvp()
    {
        new npc_remove_pvp();
    }
    SQL :

    Code:
    INSERT INTO `creature_template` VALUES ('9009002', '0', '0', '0', '0', '0', '18802', '0', '0', '0', 'Remove', 'Player vs Player', '', '0', '80', '80', '0', '35', '35', '1', '1', '1.14286', '1', '0', '0', '0', '0', '0', '1', '0', '0', '1', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '', '0', '3', '1', '1', '1', '0', '0', '0', '0', '0', '0', '0', '0', '1', '0', '0', '0', 'npc_remove_pvp', '12340');
    Example pics. demonstration with my custom npc's



    Last edited by chronicman; 03-13-2011 at 09:15 PM.

    [TrinityCore] ZwowZ, Remove PVP flags from a player npc  (free for you)
  2. #2
    chronicman's Avatar Member
    Reputation
    4
    Join Date
    Aug 2007
    Posts
    38
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Fixed and updated.

  3. #3
    Xees's Avatar Contributor

    Reputation
    92
    Join Date
    Aug 2009
    Posts
    189
    Thanks G/R
    0/2
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    good contribution +Rep
    Doooooo+Repoooooooo+Repoooooood

  4. #4
    ljsalva's Avatar Member
    Reputation
    1
    Join Date
    Jul 2008
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Update? doesn't works on last core release

    \..\..\..\Trinity\TrinityCore\src\server\scripts\Custom\npc_remove_pvp.cpp(142): error C2664: 'SpellMgr::IsSpellValid' : can't convert the parameter 1 of 'const SpellEntry *' to 'const SpellInfo *'

  5. #5
    zNemesis's Avatar Private
    Reputation
    1
    Join Date
    Aug 2011
    Posts
    11
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Nice :)

    Thank you! This helped me a lot :L
    Bump!

Similar Threads

  1. How to Block Any PvP Flag from Being Clicked on or Interacted With (PvP)
    By CollateralGaming in forum World of Warcraft Exploits
    Replies: 10
    Last Post: 02-22-2014, 06:20 PM
  2. [Selling] Fooblet's Casual Leveling/Farming/PVP Service (no bots) Safe and Convenient for you!
    By Fooblet in forum World of Warcraft Buy Sell Trade
    Replies: 0
    Last Post: 04-01-2012, 05:49 PM
  3. force players' pvp flag on
    By spacemonkey999 in forum WoW EMU Exploits & Bugs
    Replies: 4
    Last Post: 03-25-2010, 11:14 PM
  4. Remove PVP flag from yourself
    By Frankyboy in forum World of Warcraft Exploits
    Replies: 10
    Last Post: 03-03-2008, 08:56 PM
All times are GMT -5. The time now is 08:10 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