Alright this is a simple graveyard protection based on Discover’s Anti-PVP script.
its very simple this SQL spawns 4 NPCs in WSG and AB that will protect against Graveyard camping.
In WSG this script should remove the flag from the player and then port them.
SET @ENTRY_H_WSG := 60002; – Agro to Alliance
SET @ENTRY_A_WSG := 60003; – Agro to Horde
SET @ENTRY_H_AB := 60004; – Agro to Alliance
SET @ENTRY_A_AB := 60005; – Agro to Horde
SET @SPELL_STUN := 34510; – Stun Spell
SET @GUID := 2096021; – Creature Location GUID
DELETE FROM smart_scripts
WHERE source_type
=0 AND entryorguid
IN (@ENTRY_H_WSG, @ENTRY_A_WSG, @ENTRY_H_AB, @ENTRY_A_AB);
INSERT INTO smart_scripts
(entryorguid
,source_type
,id
,link
,event_type
,event_phase_mask
,event_chance
,event_flags
,event_param1
,event_param2
,event_param3
,event_param4
,action_type
,action_param1
,action_param2
,action_param3
,action_param4
,action_param5
,action_param6
,target_type
,target_param1
,target_param2
,target_param3
,target_x
,target_y
,target_z
,target_o
,comment
) VALUES
(@ENTRY_H_WSG,0,1,2,4,0,100,0,0,0,0,0,11,@SPELL_STUN,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG aggro Stun Spell”),
(@ENTRY_H_WSG,0,2,3,61,0,100,0,0,0,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Whisper”),
(@ENTRY_H_WSG,0,3,4,61,0,100,0,0,0,0,0,20,0,0,0,0,0,0,1,0,0,0,0,0,0,0,“GYG Script Stop Atk”),
(@ENTRY_H_WSG,0,4,5,61,0,100,0,0,0,0,0,28,23333,0,0,0,0,0,7,0,0,0,0,0,0,0,“GYG Remove Alliance Flag”),
(@ENTRY_H_WSG,0,5,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 1”),
(@ENTRY_H_WSG,0,6,0,0,1,100,0,4000,4000,0,0,62,489,0,0,0,0,0,7,0,0,0,1349.01,1460.98,323.287,3.131560,“GYGPort Teleport Script Alliance WSG”),
(@ENTRY_H_WSG,0,7,0,0,1,100,0,0,0,0,0,23,0,1,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 0”),
(@ENTRY_A_WSG,0,1,0,0,0,100,0,0,0,0,0,11,@SPELL_STUN,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Stun Spell”),
(@ENTRY_A_WSG,0,2,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Whisper”),
(@ENTRY_A_WSG,0,3,0,0,0,100,0,200,200,0,0,20,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Stop Atk”),
(@ENTRY_A_WSG,0,4,0,0,0,100,0,0,0,0,0,28,23335,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Remove Horde Flag”),
(@ENTRY_A_WSG,0,5,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 1”),
(@ENTRY_A_WSG,0,6,0,0,0,100,0,4000,4000,0,0,62,489,0,0,0,0,0,7,0,0,0,1123.54,1462.56,315.89,0.033160,“GYGPort Teleport Script Horde WSG”),
(@ENTRY_A_WSG,0,7,0,0,1,100,0,0,0,0,0,23,0,1,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 0”),
(@ENTRY_H_AB,0,1,0,0,0,100,0,0,0,0,0,11,@SPELL_STUN,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Stun Spell”),
(@ENTRY_H_AB,0,2,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Whisper”),
(@ENTRY_H_AB,0,3,0,0,0,100,0,200,200,0,0,20,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Stop Atk”),
(@ENTRY_H_AB,0,4,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 1”),
(@ENTRY_H_AB,0,5,0,0,0,100,0,4000,4000,0,0,62,529,0,0,0,0,0,7,0,0,0,1282.43,1277.95,-16.004154,3.983538,“GYGPort Teleport Script Alliance AB”),
(@ENTRY_H_AB,0,6,0,0,1,100,0,0,0,0,0,23,0,1,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 0”),
(@ENTRY_A_AB,0,1,0,0,0,100,0,0,0,0,0,11,@SPELL_STUN,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Stun Spell”),
(@ENTRY_A_AB,0,2,0,0,0,100,0,200,200,0,0,1,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Whisper”),
(@ENTRY_A_AB,0,3,0,0,0,100,0,200,200,0,0,20,0,0,0,0,0,0,2,0,0,0,0,0,0,0,“GYG Script Stop Atk”),
(@ENTRY_A_AB,0,4,0,61,0,100,0,0,0,0,0,23,1,0,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 1”),
(@ENTRY_A_AB,0,5,0,0,0,100,0,4000,4000,0,0,62,529,0,0,0,0,0,7,0,0,0,712.012,712.256,-17.198536,0.802675,“GYGPort Teleport Script Horde AB”),
(@ENTRY_A_AB,0,6,0,0,1,100,0,0,0,0,0,23,0,1,0,0,0,0,1,0,0,0,0,0,0,0,“GYGSet phase 0”);
DELETE FROM creature_text
WHERE entry
IN (@ENTRY_H_WSG, @ENTRY_A_WSG, @ENTRY_H_AB, @ENTRY_A_AB);
INSERT INTO creature_text
(entry
,groupid
,id
,text
,type
,language
,probability
,emote
,duration
,sound
,comment
) VALUES
(@ENTRY_H_WSG,0,0,“PlEASE DO NOT CAMP GRAVEYARD, $N. I will teleport you to you’re side now.”,15,0,100,0,0,0,“GYG Script Whisper”),
(@ENTRY_A_WSG,0,0,“PlEASE DO NOT CAMP GRAVEYARD, $N. I will teleport you to you’re side now.”,15,0,100,0,0,0,“GYG Script Whisper”),
(@ENTRY_H_AB,0,0,“PlEASE DO NOT CAMP GRAVEYARD, $N. I will teleport you to you’re side now.”,15,0,100,0,0,0,“GYG Script Whisper”),
(@ENTRY_A_AB,0,0,“PlEASE DO NOT CAMP GRAVEYARD, $N. I will teleport you to you’re side now.”,15,0,100,0,0,0,“GYG Script Whisper”);
DELETE FROM creature_template
WHERE entry
IN (@ENTRY_H_WSG, @ENTRY_A_WSG, @ENTRY_H_AB, @ENTRY_A_AB);
INSERT INTO creature_template
(entry
, difficulty_entry_1
, difficulty_entry_2
, difficulty_entry_3
, KillCredit1
, KillCredit2
, modelid1
, modelid2
, modelid3
, modelid4
, name
, subname
, IconName
, gossip_menu_id
, minlevel
, maxlevel
, exp
, faction_A
, faction_H
, npcflag
, speed_walk
, speed_run
, scale
, rank
, mindmg
, maxdmg
, dmgschool
, attackpower
, dmg_multiplier
, baseattacktime
, rangeattacktime
, unit_class
, unit_flags
, unit_flags2
, dynamicflags
, family
, trainer_type
, trainer_spell
, trainer_class
, trainer_race
, minrangedmg
, maxrangedmg
, rangedattackpower
, type
, type_flags
, lootid
, pickpocketloot
, skinloot
, resistance1
, resistance2
, resistance3
, resistance4
, resistance5
, resistance6
, spell1
, spell2
, spell3
, spell4
, spell5
, spell6
, spell7
, spell8
, PetSpellDataId
, VehicleId
, mingold
, maxgold
, AIName
, MovementType
, InhabitType
, HoverHeight
, Health_mod
, Mana_mod
, Armor_mod
, RacialLeader
, questItem1
, questItem2
, questItem3
, questItem4
, questItem5
, questItem6
, movementId
, RegenHealth
, equipment_id
, mechanic_immune_mask
, flags_extra
, ScriptName
, WDBVerified
) VALUES
(@ENTRY_H_WSG, 0, 0, 0, 0, 0, 17519, 11686, 0, 0, ‘Invisible Graveyard Stalker Agro Alliance’, ‘Graveyard Protection’, ‘’, 0, 85, 85, 0, 85, 85, 0, 31.25, 100, 1, 2, 104, 138, 0, 252, 1, 2000, 1, 1, 33587590, 0, 0, 0, 0, 0, 0, 0, 72, 106, 26, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ‘SmartAI’, 0, 4, 1, 1.35, 1, 2.5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 384, ‘’, -1),
(@ENTRY_H_AB, 0, 0, 0, 0, 0, 17519, 11686, 0, 0, ‘Invisible Graveyard Stalker Agro Alliance’, ‘Graveyard Protection’, ‘’, 0, 85, 85, 0, 85, 85, 0, 31.25, 100, 1, 2, 104, 138, 0, 252, 1, 2000, 1, 1, 33587590, 0, 0, 0, 0, 0, 0, 0, 72, 106, 26, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ‘SmartAI’, 0, 4, 1, 1.35, 1, 2.5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 384, ‘’, -1),
(@ENTRY_A_WSG, 0, 0, 0, 0, 0, 17519, 11686, 0, 0, ‘Invisible Graveyard Stalker Agro Horde’, ‘Graveyard Protection’, ‘’, 0, 85, 85, 0, 11, 11, 0, 31.25, 100, 1, 2, 104, 138, 0, 252, 1, 2000, 1, 1, 33587590, 0, 0, 0, 0, 0, 0, 0, 72, 106, 26, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ‘SmartAI’, 0, 4, 1, 1.35, 1, 2.5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 384, ‘’, -1),
(@ENTRY_A_AB, 0, 0, 0, 0, 0, 17519, 11686, 0, 0, ‘Invisible Graveyard Stalker Agro Horde’, ‘Graveyard Protection’, ‘’, 0, 85, 85, 0, 11, 11, 0, 31.25, 100, 1, 2, 104, 138, 0, 252, 1, 2000, 1, 1, 33587590, 0, 0, 0, 0, 0, 0, 0, 72, 106, 26, 10, 8, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, ‘SmartAI’, 0, 4, 1, 1.35, 1, 2.5, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 384, ‘’, -1);
DELETE FROM creature
WHERE id
IN (@ENTRY_H_WSG, @ENTRY_A_WSG, @ENTRY_H_AB, @ENTRY_A_AB) AND guid
BETWEEN @GUID+0 AND @GUID+3;
INSERT INTO creature
(guid
,id
,map
,spawnMask
,phaseMask
,modelid
,equipment_id
,position_x
,position_y
,position_z
,orientation
,spawntimesecs
,spawndist
,currentwaypoint
,curhealth
,curmana
,MovementType
,npcflag
,unit_flags
,dynamicflags
) VALUES
(@GUID+0, @ENTRY_H_WSG, 489, 1, 1, 0, 0, 1035.93, 1387.47, 341.434, 1.09178, 300, 0, 0, 1, 0, 0, 0, 0, 0),
(@GUID+1, @ENTRY_A_WSG, 489, 1, 1, 0, 0, 1419.21, 1554.74, 343.408, 4.16358, 300, 0, 0, 1, 0, 0, 0, 0, 0),
(@GUID+2, @ENTRY_H_AB, 529, 1, 1, 0, 0, 712.372, 648.414, -11.1677, 1.74279, 300, 0, 0, 1, 0, 0, 0, 0, 0),
(@GUID+3, @ENTRY_A_AB, 529, 1, 1, 0, 0, 1352.14, 1279.03, -11.5695, 2.95938, 300, 0, 0, 1, 0, 0, 0, 0, 0);
This is untested, i’m sorry but i don’t have anywhere to test this currently to make sure its working properly. this is also my first shot at it
If you can look it over or test it let me know thanks !