Sanctuary NPC [LUA] menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 19
  1. #1
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Sanctuary NPC [LUA]

    Sanctuary NPC [LUA]

    Hey guys, just had this script lying around and thought I'd release it.



    It's a simple LUA script that turns an NPC into a "sanctuary".

    All players who can see the NPC will be automatically de-flagged and will have FFA pvp flags removed, turning whatever zone your NPC is place in into a sanctuary.

    All you have to is put the script in your Scripts folder and run the SQL, and then go in-game and spawn NPC 993355 in whatever zone you want to be a sanctuary.


    Download:
    Lua file:
    Code:
    SANCTUARY_NPC_ID = 993355;
    
    function MallSanctuary_OnSpawn(unit, event)
    	unit:Mount(22474);
    	unit:RegisterEvent("UnflagAll", 1000, 0);	
    end
    
    function UnflagAll(unit, event)
    	local InRangePlayers = unit:GetInRangePlayers();
    	
    	for a, plr in pairs(InRangePlayers) do
    		if plr:IsPvPFlagged() then plr:TogglePvPFlag(); end
    		if plr:IsFFAPvPFlagged() then plr:ToggleFFAPvPFlag(); end
    	end
    end
    
    RegisterUnitEvent(SANCTUARY_NPC_ID, 18, "MallSanctuary_OnSpawn");
    SQL:
    Code:
    insert into `creature_names` (`entry`, `name`, `subname`, `info_str`, `Flags1`, `type`, `family`, `rank`, `unk4`, `spelldataid`, `male_displayid`, `female_displayid`, `male_displayid2`, `female_displayid2`, `unknown_float1`, `unknown_float2`, `civilian`, `leader`) 
    values ('993355', "Sha'atar Peacekeeper", "Peacekeeper", '', '2048', '7', '0', '1', '0', '0', '15511', '15511', '15511', '15511', '1', '1', '0', '0');
    
    insert into `creature_proto` (`entry`, `minlevel`, `maxlevel`, `faction`, `minhealth`, `maxhealth`, `mana`, `scale`, `npcflags`, `attacktime`, `attacktype`, `mindamage`, `maxdamage`, `can_ranged`, `rangedattacktime`, `rangedmindamage`, `rangedmaxdamage`, `respawntime`, `armor`, `resistance1`, `resistance2`, `resistance3`, `resistance4`, `resistance5`, `resistance6`, `combat_reach`, `bounding_radius`, `auras`, `boss`, `money`, `invisibility_type`, `death_state`, `walk_speed`, `run_speed`, `fly_speed`, `extra_a9_flags`, `spell1`, `spell2`, `spell3`, `spell4`, `spell_flags`, `modImmunities`) 
    values ('993355', '90', '90', '35', '999999999', '999999999', '999999999', '1', '0', '1500', '0', '20000', '50000', '0', '0', '0', '0', '0', '99999', '666', '666', '666', '666', '666', '666', '0', '0', "40733", '1', '10500', '0', '0', '8.00', '16.00', '20.00', '0', '0', '0', '0', '0', '0', '0');
    Note: Requires GUA

    Enjoy!

    Feedback Welcome!
    Last edited by Jotox; 08-03-2009 at 01:12 PM.

    Sanctuary NPC [LUA]
  2. #2
    Hellgawd's Avatar Account not activated by Email
    Reputation
    710
    Join Date
    Jun 2007
    Posts
    2,480
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thats an interesting one! Will test and report feedback. +7

  3. #3
    stoneharry's Avatar Moderator Harry

    Authenticator enabled
    Reputation
    1613
    Join Date
    Sep 2007
    Posts
    4,554
    Thanks G/R
    151/146
    Trade Feedback
    0 (0%)
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    Wait wa- I didn't even see that function in the GuaEngine 0_0 +Rep

  4. #4
    jerrkan's Avatar Active Member
    Reputation
    84
    Join Date
    Sep 2007
    Posts
    148
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice mate! 2x rep

    Is there anyway to make it to FFA Would be cool because then u can make some custom pvp zones easy


  5. #5
    jordddm's Avatar Member
    Reputation
    11
    Join Date
    Nov 2007
    Posts
    49
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow awesome man +rep

    Edit:Yeh a FFA one would be awesome
    Edit:cant rep you atm i will later
    Last edited by jordddm; 08-03-2009 at 12:52 PM.

  6. #6
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Edited the script, it now removes FFA flags as well.

  7. #7
    namelessgnome's Avatar Contributor
    Reputation
    108
    Join Date
    May 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice idea, but can't you just edit the server side AreaTable.dbc?

    Anyhow, Nice script +REP


    EDIT: Gotta Spread

  8. #8
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This can make an area within a zone into a sanctuary, or can be used to set an area that's not used on retail (areas where zone IDs are always 0) to be a sanctuary. Etc.

    Like if you had a pvp zone, you could make a mall inside the pvp zone that would be a sanctuary. using this npc.

  9. #9
    namelessgnome's Avatar Contributor
    Reputation
    108
    Join Date
    May 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    True

    There are other ways of doing this but this one is the simplest!

  10. #10
    Gastricpenguin's Avatar Legendary
    Reputation
    980
    Join Date
    Feb 2007
    Posts
    2,236
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Theory: If you have 90 pvp flagged players in this area, it will take 90 seconds to toggle them off. Even then they can just /pvp back.

  11. #11
    jerrkan's Avatar Active Member
    Reputation
    84
    Join Date
    Sep 2007
    Posts
    148
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Jotox1 that i mean was if u can make a NPC that make every1 get FFA flags ^^
    If can u tell me what i need to edit please


  12. #12
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mm nope gastric, it unflags all in range players once every second, not one per second
    Last edited by Jotox; 08-03-2009 at 02:57 PM.

  13. #13
    namelessgnome's Avatar Contributor
    Reputation
    108
    Join Date
    May 2007
    Posts
    263
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Would be awesome if you could port this to C++ as that would make the script even more useful on bigger server where the Lua overhead would waste lots precious CPU Time .

  14. #14
    Jotox's Avatar Contributor
    Reputation
    250
    Join Date
    Mar 2008
    Posts
    282
    Thanks G/R
    0/4
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Here's a script to make it flag em instead of unflag em

    Code:
    SANCTUARY_NPC_ID = 993355;
    
    function MallSanctuary_OnSpawn(unit, event)
    	unit:Mount(22474);
    	unit:RegisterEvent("UnflagAll", 1000, 0);	
    end
    
    function UnflagAll(unit, event)
    	local InRangePlayers = unit:GetInRangePlayers();
    	
    	for a, plr in pairs(InRangePlayers) do
    		if not plr:IsPvPFlagged() then plr:TogglePvPFlag(); end
    		if not plr:IsFFAPvPFlagged() then plr:ToggleFFAPvPFlag(); end
    	end
    end
    
    RegisterUnitEvent(SANCTUARY_NPC_ID, 18, "MallSanctuary_OnSpawn");
    That'll set everyone in range to be flagged and FFA flagged.
    If they go out of range of the npc... remember, there's nothing removing the flag from them! (unless they zone)

  15. #15
    jerrkan's Avatar Active Member
    Reputation
    84
    Join Date
    Sep 2007
    Posts
    148
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Wow! thanks again mate. <3!


Page 1 of 2 12 LastLast

Similar Threads

  1. [Release]Buffer npc lua
    By Noobcraft in forum WoW EMU General Releases
    Replies: 8
    Last Post: 10-04-2008, 07:20 AM
  2. [Release]Instant 70 Npc Lua
    By Noobcraft in forum WoW EMU General Releases
    Replies: 27
    Last Post: 09-08-2008, 11:28 PM
  3. Teleporter NPC LUA
    By Performer in forum WoW EMU Questions & Requests
    Replies: 7
    Last Post: 08-21-2008, 08:04 AM
  4. [Release] Info NPC -- LUA
    By Babbaa in forum WoW EMU General Releases
    Replies: 6
    Last Post: 08-17-2008, 02:29 PM
  5. Will this teleporter npc lua script work?
    By Bapes in forum World of Warcraft Emulator Servers
    Replies: 9
    Last Post: 05-22-2008, 11:50 AM
All times are GMT -5. The time now is 07:22 PM. 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