[Request] Anti-PvP C++ Script menu

User Tag List

Results 1 to 9 of 9
  1. #1
    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)

    [Request] Anti-PvP C++ Script

    Hello scripters of MMOwned ^_^
    If you are looking for something to do, you may help me =D

    Okay let's get to the point
    I want a C++ script that i can use instead of neutral guards (They cause lag, attacks slow, ugly to have around :P etc etc).

    The script will be like this:
    When a player hits/sheeps/saps/traps the victim player (of the other faction) the player will get instantly killed- no damage or effect will be done to the victim(s). The player will also get a warning in a text says "No PvP allowed here!".

    Also, this must only apply to a single zone or map id.

    If you have any questions, comments or anything- please post it.
    Ofc, i will +Rep good answers.
    https://nordicwow.servegame.com/ +Rep

    [Request] Anti-PvP C++ Script
  2. #2
    XxCyanidexX's Avatar Member
    Reputation
    56
    Join Date
    Nov 2008
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Double post
    Last edited by XxCyanidexX; 04-08-2009 at 04:34 PM.

  3. #3
    XxCyanidexX's Avatar Member
    Reputation
    56
    Join Date
    Nov 2008
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well couldn't you just make the zone a sanctuary? Or are you into more disciplinary solutions :P.

    Well I wrote a script with the OnKillPlayer hook, which means that the victim has to die first :/ because I don't think there is a hook for OnAttack with snares, sheep, etc... Well this one revives the victim and kills the killer, but its after the victim has died.. so, hope you use it! :P

    Code:
    //Anti-PvP Script
    //Created by Cyanide for Kaato
    
    #include "StdAfx.h"
    #include "Setup.h"
    
    #define kmapid YOURMAPIDHERE
    
    void AntiPvp(Player * pPlayer, Player * pVictim)
    {
    	if(pPlayer->GetMapId() == kmapid && pVictim->GetMapId() == kmapid)//Make sure that they both are on the same map, you can change it if you want.
    	{
    		pPlayer->KillPlayer();
    		pPlayer->BroadcastMessage("|cffFF0000You have been caught killing %s in a non-PvP area.  You have been killed as a punishment.  Any further PvP in this area will result in a ban.|r", pVictim->GetName());//Feel free to edit.
    		pVictim->ResurrectPlayer();
    		pVictim->BroadcastMessage("|cff00FF00%s has killed you in a non-PvP zone, and they have been killed as a punishment, and you have been revived.  If %s continues to attack you, please report him/her.|r", pPlayer->GetName(), pPlayer->GetName());//Feel free to edit.
    	}
    	else
    	{
    		return;
    	}
    }
    
    void SetupAntiPvP(ScriptMgr * mgr)
    {
    	mgr->register_hook(SERVER_HOOK_EVENT_ON_KILL_PLAYER, (void *) AntiPvp);
    }
    Last edited by XxCyanidexX; 04-08-2009 at 04:52 PM.

  4. #4
    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)
    Hmm, wasn't exacly what i needed =(
    Isn't it any other ways to do "Anti-PvP" then?
    Without guards or any zone editing ..

    Btw, there will be no mobs in that area (just vendors etc)- in case if you can do something from there :P
    Thanks for helping btw =) <3
    https://nordicwow.servegame.com/ +Rep

  5. #5
    Herleybob's Avatar Contributor
    Reputation
    178
    Join Date
    Jul 2007
    Posts
    663
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why dont you just edit the core, go to where it handles Pvp on, and make it just not turn it on.

    Nom Nom Nom :P

  6. #6
    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)
    This is going to be used in a City Zone, i still want to allow pvp in the other zones...
    https://nordicwow.servegame.com/ +Rep

  7. #7
    XxCyanidexX's Avatar Member
    Reputation
    56
    Join Date
    Nov 2008
    Posts
    138
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I can write it with the OnDealDamage one, but I haven no guarantee that it will work with sheeping/binding, and anyway, zone editing is easier than writing a script.

  8. #8
    doublehex's Avatar Member
    Reputation
    34
    Join Date
    Mar 2007
    Posts
    385
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    you can add in a check for a nearby npc that you want to have as the anti-pvp npc, example:
    Creature *pCreature = pPlayer->GetMapMgr()->GetInterface()->GetCreatureNearestCoords(pPlayer->GetPositionX(), pPlayer->GetPositionY(), pPlayer->GetPositionZ(), ANTIPVPNPCID);
    if (!pCreature)
    {return;}
    float dist = pCreature->CalcDistance(pPlayer->GetPositionX(),pPlayer->GetPositionY(),pPlayer->GetPositionZ());
    if (dist <= 100.0)
    {
    //do blah blah blah
    }


  9. #9
    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)
    The OnDealDamage will be fine
    But you could maybe use some RemoveAura / revivestuff on the player instead?
    https://nordicwow.servegame.com/ +Rep

Similar Threads

  1. Replies: 0
    Last Post: 07-27-2015, 04:33 PM
  2. Anti-PvP Guard script help
    By gimmeurlife in forum WoW EMU Questions & Requests
    Replies: 0
    Last Post: 06-16-2009, 12:32 AM
  3. [Request] Anti pvp Guard C++
    By mjas in forum WoW EMU Questions & Requests
    Replies: 3
    Last Post: 10-14-2008, 05:41 AM
  4. [Request]Alliance PvP mounts -> Pig
    By Lamoot in forum WoW ME Questions and Requests
    Replies: 2
    Last Post: 03-23-2008, 07:29 PM
  5. Request: Warlord PVP Armor Set (Warrior) --> Tier 2.5
    By dirtywowgurrl in forum WoW ME Questions and Requests
    Replies: 4
    Last Post: 01-01-2007, 01:02 PM
All times are GMT -5. The time now is 10:56 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