How to add this into my folder menu

Shout-Out

User Tag List

Results 1 to 5 of 5
  1. #1
    arthur1265's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to add this into my folder

    Hey, ive been loooking for a anti-pvp guard for sometime now.. and i found the code berry posted in his old old topic.. but unfortunately i have NO idea what to do with it... please help me and tell me where to put this in order to make guards attack whenever someone enters combat with another for my neutral mall.. thank you


    heres the code
    Code:
    #include "StdAfx.h"
    void OnEnterCombat(Player *pPlayer, Unit *pTarget); //Function Header
    extern "C" SCRIPT_DECL uint32 _exp_get_version()
    {
        return MAKE_SCRIPT_VERSION(SCRIPTLIB_VERSION_MAJOR, SCRIPTLIB_VERSION_MINOR);
    }
    
    extern "C" SCRIPT_DECL void _exp_script_register(ScriptMgr* mgr)
    {
         ::sScriptMgr.register_hook(SERVER_HOOK_EVENT_ON_ENTER_COMBAT, OnEnterCombat);
    }
    #ifdef WIN32
    
    BOOL APIENTRY DllMain( HANDLE hModule, DWORD  ul_reason_for_call, LPVOID lpReserved )
    {
        return TRUE;
    }
    
    #endif
    
    #define NOPVPGUARD 1 //ID for the anti PVP creature
    #define MAX_DISTANCE 70.0 //Distance they must be within for the guard to agro
    #define KILL_SPELL 5 //The spell used when they get agro - death touch
    #define UNIT_INSTANT true //Instant cast spell? true or false
    unsigned Zones[4] = { 33,440,618,3523, }; //STV,Tanaris,winterspring,netherstorm
    void OnEnterCombat(Player *pPlayer, Unit *pTarget)
    {
        bool InZone = false;
        for (int C = 0; C < 4; C++) 
            {
            if (pPlayer->GetZoneId() == Zones[C]) {InZone = true;}
            }
        if (InZone == false) {return;}
        Creature *pCreature = pPlayer->GetMapMgr()->GetSqlIdCreature(NOPVPGUARD);
        if (!pCreature) {return;} //No creature found, handle gracefully and return
        float dist = pCreature->CalcDistance(pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ());
        if (dist <= MAX_DISTANCE)
            {
            Unit *pUnit = (Unit *)pPlayer; //Cast the pointer to a Unit object
            pCreature->GetAIInterface()->AttackReaction(pUnit,0,0); //Attack! (not sure about the second and third params here, set to 0 to be safe
            if (KILL_SPELL != NULL)
                pCreature->CastSpell(pUnit,KILL_SPELL,UNIT_INSTANT);
            }
    }

    How to add this into my folder
  2. #2
    runiker's Avatar Contributor
    Reputation
    105
    Join Date
    Nov 2007
    Posts
    501
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    1. it must be compiled
    2. its your scripts bin
    3. fyi it takes alot of cpu to run this

  3. #3
    arthur1265's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    uh.. i dont even know how to compile this =/
    also, we are running the server on a dedicated server computer provided by a company... so cpu should be fine?
    Last edited by arthur1265; 07-09-2008 at 11:38 PM.

  4. #4
    Hasbro's Avatar Banned
    Reputation
    65
    Join Date
    Dec 2007
    Posts
    334
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Maybe you shouldn't be running a server if you don't know how to compile a script.
    Also, I'd recommend you contact Berryman about this considering its his code.
    ^

  5. #5
    arthur1265's Avatar Member
    Reputation
    1
    Join Date
    Jun 2008
    Posts
    20
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    hehe, im just the head GM.... dev stuff goes whoooosh over my head.. i just was the only one on and wanted to see if i could do this ><

Similar Threads

  1. [Video Tutorial] How to add custom items into a Cataclysm WoW Private Server.
    By theduncehat in forum WoW EMU Guides & Tutorials
    Replies: 5
    Last Post: 09-10-2024, 03:14 PM
  2. Noggit ( How to add into Wow/Server )
    By Musly in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 03-15-2010, 10:43 AM
  3. How do i replace/add sounds into WoW?
    By fastelf in forum World of Warcraft General
    Replies: 1
    Last Post: 03-21-2009, 07:09 PM
  4. Replies: 0
    Last Post: 01-08-2008, 02:37 AM
  5. How to add Images?
    By Fault in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 08-17-2006, 05:54 PM
All times are GMT -5. The time now is 03:27 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