Forum
 
Go Back   D3scene > Hot Games > WoW forum > WoW Emulator Server Discussion

NoN-pvp area gaurd

This is a discussion on NoN-pvp area gaurd within the WoW Emulator Server Discussion forum part of the WoW forum category; all credit goes to my pal megafreakzla *no setup file srry C++ source Code: ######################################## ############### Anti-PVP Guard######### ######################################## ##########Credits ...

Welcome on D3scene.com! Make sure to register - it's free and very quick! You have to register before you can post and participate in our discussions with 35000 other registered members. Downloads, user profiles and some forums can only be seen by registered members. After you create your free account you will be able to customize many options, you will have the full access to new hacks, latest cheats and last but not least will see no advertisements at all. We would love to see you around in our community!
Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 07-18-2008, 02:04 AM
vashidu's Avatar
Member
 
Join Date: Jul 2008
Posts: 26
Reputation: 3
Rep Power: 1
vashidu is an unknown quantity at this point
Thumbs up NoN-pvp area gaurd

all credit goes to my pal megafreakzla
*no setup file srry
C++ source
Code:
########################################
############### Anti-PVP Guard#########
########################################
##########Credits to megafreakzla############
########################################

/******************************************************/
/*                    Anti PVP guard                  */
/*                    By megafreakzla                 */
/*                    Redistribution prohibited       */
/******************************************************/
#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 10000 //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);
        }
}
[size=6]sorry no sql BUT your custom npc for it needs to have a entry id of 10000



[/SIZ

Last edited by vashidu; 07-18-2008 at 02:11 AM.
Reply With Quote
D3scene
Welcome to D3scene - probably the best location for all Gamers.

To participate in our friendly environment you have to register. After completing registration you will have full access to all threads and features. We care about members and try to make your stay as pleasant as possible. We are unique with the following feature for members - you will not see a single Advertisement!


The best: registration is completely free. It will not cost you a single penny or harm you in any way. You will lose nothing except 1 minute of your time. So why not register? We would be happy to see you around!
Reply

Tags
ascent, c++, npc, telly, vashidu

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
The Ultimate WoW PVP Guide of Knowledge Havok WoW Guides 7 09-21-2008 02:00 AM
[WoW] Instant 70, PvP Funserver & High Rate! Silentcloud WoW Private Servers ADs 1 07-01-2008 12:16 PM
Half-Life 2 Guide Feena Half Life 2 0 06-25-2008 08:21 PM
PVP Beginners guide Diesel Guild Wars 0 06-25-2008 07:50 PM
[WoW] Instant 70 PvP Funserver! Silentcloud WoW Private Servers ADs 0 06-09-2008 06:03 PM


All times are GMT +1. The time now is 08:17 AM.


vBulletin style developed by Transverse Styles
Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0 ©2008, Crawlability, Inc.

»About D3scene »Navigation