[Lua] Soulstone Vagabond menu

Shout-Out

User Tag List

Results 1 to 3 of 3
  1. #1
    haphaz's Avatar Member
    Reputation
    8
    Join Date
    Oct 2006
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [Lua] Soulstone Vagabond

    I'm trying to develop an npc (which I currently have flying around in the air) that will automatically cast a soulstone whenever someone is in range of 40yds or so. (Basically you fall down past this npc and you become soulstoned) I call it a Soulstone Vagabond.

    I used to have this working, but I had to disable it due the the insane amount of errors it caused in the console and the lag it started to build up on my server. Any LUA junkies able to help me out with this? I'm still trying to learn. I WILL +rep you x2 if you can successfully help me figure this out.

    This is what I currently have:

    Code:
    function Vagabond_SS_Cast (pUnit, Event)
    pUnit:CastSpellOnTarget(27239, pUnit:GetClosestPlayer()) 
    end
    
    function Vagabond_SS (pUnit, Event)
    pUnit:RegisterEvent("Vagabond_SS_Cast",1000, 0)
    end
    
    RegisterUnitEvent (998158, 6, "Vagabond_SS")
    Basically, what it currently does is spam cast soulstone every second, and whenever someone passes in range, it hits them. When no one is in range, it spams error messages every 1 second in the console and causes lag. I know I need some sort of IF "a player is in range" condition, but I'm still fairly new to LUA and haven't been able to figure this out.

    Thanks for looking at this for me :P

    [Lua] Soulstone Vagabond
  2. #2
    kreegoth's Avatar Contributor
    Reputation
    122
    Join Date
    Jun 2008
    Posts
    810
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    /************************************************** **********************/
    /* SCRIPT FUNCTION TABLES */
    /************************************************** **********************/
    Item Gossip Commands
    "GossipCreateMenu" - Creates a Gossip Menu for an Item.
    "GossipMenuAddItem" - Adds a Gossip Item for an Item. (Something a Player can chose from)
    "GossipSendMenu" - Sends the Menu to the Player.
    "GossipComplete" - Comples the Gossip. (Probably same as RemoveEvents())
    "GossipSendPOI" - [P]oint [o]f [i]nteresting - Set a Mark to your Minimap
    
    Unit Gossip Commands
    "GossipCreateMenu" - Creates a Gossip Menu for an NPC.
    "GossipMenuAddItem" - Adds a Gossip Item for an NPC.
    "GossipSendMenu" - Sends the Menu to the Player.
    "GossipComplete" - Completes the Gossip. (Probably same as RemoveEvents())
    "GossipSendPOI" - [P]oint [o]f [i]nteresting - Set a Mark to your Minimap
    
    Unit Commands
    "GetName" - Gets the Player's name.
    "SendChatMessage" - Send's a Chat Message to the World/Area.
    "MoveTo" - Moves the NPC to the desired location on the same Map.
    "SetMovementType" - Sets the movement type of the NPC.
    "CastSpell" - Casts a Spell on the NPC (Itself)
    "FullCastSpell" - UNUSED.
    "CastSpellOnTarget" - UNUSED.
    "FullCastSpellOnTarget" - Casts a Spell on the desired Target.
    "SpawnCreature" - Spawns creature on the desired Position.
    "SpawnGameObject" - Spawns a GameObject on the desired Position.
    "GetX" - Gets the Position: X
    "GetY" - Gets the Position: Y
    "GetZ" - Gets the Position: Z
    "GetO" - Gets the Position: O
    "IsPlayer" - Returns true if the Unit is a Player. False otherwise.
    "IsCreature" - Returns true if the Unit is a Creature. False otherwise.
    "RegisterEvent" - Registers an Event with the name "" every "" milliseconds, "" times.
    "RemoveEvents" - Removes all Events. (Used at ends of Phases, and on UnitEvents)
    "SendBroadcastMessage" - Sends a Broadcast Message server-wide.
    "SendAreaTriggerMessage" - Sends an AreaTrigger message, player-wide.
    "KnockBack" - Knocks the Player(s) back _____ yards.
    "MarkQuestObjectiveAsComplete" - Marks the Quest Objective "" as complete. (In the Character's Questlog)
    "LearnSpell" - Learns the Spell "" to the Character.
    "UnlearnSpell" - Unlearns the Spell "" to the Character.
    "HasFinishedQuest" - Returns true if the Unit has finished the Quest "". False otherwise.
    "GetItemCount" - Generates the Item Count of Item "" from the Unit.
    "IsInCombat" - Returns true if the Unit is in Combat. False otherwise.
    "GetMainTank" - Targets the main Tank.
    "GetAddTank" - Targets the main Tank. (Bugs may occur)
    "ClearThreatList" - Clears the threat list. (Aggro list, etc.)
    "GetTauntedBy" - UNKOWN. (EDIT IF YOU KNOW)
    "SetTauntedBy" - Sets the Unit the NPC is taunted by.
    "SetSoulLinkedWith" - Sets the Unit the NPC is soullinked with. (SQL-ID)
    "GetSoulLinkedWith" - UNKNOWN. (EDIT IF YOU KNOW)
    "ChangeTarget" - Changes Target (EDIT IF YOU KNOW MORE INFO)
    "GetHealthPct" - Gets the NPC's Health Point (%)
    "SetHealthPct" - Sets the NPC's Health Points (%)
    "GetManaPct" - Gets the NPC's Mana Points (%, bugs may occur)
    "Despawn" - Despawns the NPC in "" milliseconds, respawning in "" milliseconds.
    "GetUnitBySqlId" - Retruns a Unit from the SQL ID.
    "PlaySoundToSet" - Plays a Sound, Server-wide. (Sounds found in DBC)
    "RemoveAura" - Removes a Spell casted by CastSpell.
    "StopMovement" - Stops all movement.
    "Emote" - Performs an Emote found in the Emote C++ File.
    "GetInstanceID" - UNKNOWN. (EDIT IF YOU KNOW)
    "GetClosestPlayer" - Targets the Closest Player to the NPC.
    "GetRandomPlayer" - Targets a Random Player.
    "GetRandomFriend" - Targets a Random Friendly Unit.
    "AddItem" - Adds an Item with the ID "" to the Target.
    "RemoveItem" - Removes an Item with the ID "" from the Target.
    "CreateCustomWaypointMap" - Creates a custom Waypoint Map for the NPC. (Allows Waypoints to be placed)
    "CreateWaypoint" - Creates a Waypoint to the desired Position.
    "MoveToWaypoint" - Moves the NPC to the Waypoint with the ID of "".
    "DestroyCustomWaypointMap" - Destroys the custom Waypoint Map for the NPC. (Deletes all Waypoints)
    "SetCombatCapable" - Sets whether Combat is enabled for the NPC.
    "SetCombatMeleeCapable" - Sets whether Melee Combat is enabled for the NPC.
    "SetCombatRangedCapable" - Sets whether Ranged Combat is enabled for the NPC.
    "SetCombatSpellCapable" - Sets whether Spell Combat is enabled for the NPC.
    "SetCombatTargetingCapable" - Sets whether Targeting is enabled for the NPC. (Makes NPC not look at the Players)
    "SetNPCFlags" - Sets the NPCFlags of the Creature.
    "SetModel" - Sets the Model/Display ID of the NPC.
    "SetScale" - Sets the Scale of the NPC.
    "SetFaction" - Sets the Faction of the NPC.
    "SetStandState" - Sets the Standstate of the NPC.
    "Teleport" - Teleports the NPC to the desired position.
    "GetPlayerClass" - Returns the Class of the targeted Player.
    "ClearThreatList" - Clears the Threat list. (Aggro list)
    "WipeThreatList" - Wipes the Threat list. (Aggro list, same as ClearThreatList?)
    "WipeTargetList" - Wipes the target list.
    "WipeCurrentTarget" - Wipes the current target from the aggro list (Chooses a new Main Tank)
    "GetHealth" - Returns how much Health Points the NPC has. (%)
    "GetMaxHealth" - Returns the max Health Points the NPC has.
    "SetHealth" - Sets the Health Points of the NPC. (%)
    "SetMaxHealth" - Sets the max Health Points the NPC has.
    "SetFieldFlags" - The same as SetUInt32/64Value (Field, Value) 
    
    GameObject Commands
    "GetName" - Returns the name of the Player.
    "Teleport" - Teleports the Player to the desired Position.
    
    GameObject Gossip Commands
    "GossipCreateMenu" - Creatures a Gossip Menu for the GameObject.
    "GossipMenuAddItem" - Creates a Gossip Item to the Menu.
    "GossipSendMenu" - Sends the Menu to the Player. (Allows the Player to see it)
    "GossipComplete" - Completes the Gossip. (Same as RemoveEvents()?)
    "GossipSendPOI" - [P]oint [o]f [i]nteresting - Set a Mark to your Minimap  
    
    Quote:
    RandomFlags
    RANDOM_ANY = 0,
    RANDOM_IN_SHORTRANGE = 1,
    RANDOM_IN_MIDRANGE = 2,
    RANDOM_IN_LONGRANGE = 3,
    RANDOM_WITH_MANA = 4,
    RANDOM_WITH_RAGE = 5,
    RANDOM_WITH_ENERGY = 6,
    RANDOM_NOT_MAINTANK = 7  
    
    These are the RandomFlags for the NPC Command: GetRandomPlayer(#).
    
    
    Quote:
    Creature Events
    CREATURE_EVENT_ON_ENTER_COMBAT = 1,
    CREATURE_EVENT_ON_LEAVE_COMBAT = 2,
    CREATURE_EVENT_ON_KILLED_TARGET = 3,
    CREATURE_EVENT_ON_DIED = 4,
    CREATURE_EVENT_AI_TICK = 5,
    CREATURE_EVENT_ON_SPAWN = 6,
    CREATURE_EVENT_ON_GOSSIP_TALK = 7,
    CREATURE_EVENT_ON_REACH_WP = 8,
    CREATURE_EVENT_ON_LEAVE_LIMBO = 9,
    CREATURE_EVENT_PLAYER_ENTERS_RANGE = 10,  
    
    These are the UnitEvents for Registering the Script to the correct NPC. 
    
    
    Quote:
    GameObject Events
    GAMEOBJECT_EVENT_ON_SPAWN = 1,
    GAMEOBJECT_EVENT_ON_USE = 2,  
    
    These are used for the GameObjectEvents used for Registering the Script to the correct GameObject.
    
    
    Quote:
    Gossip Events
    GOSSIP_EVENT_ON_TALK = 1,
    GOSSIP_EVENT_ON_SELECT_OPTION = 2,
    GOSSIP_EVENT_ON_END = 3,  
    
    These are the GossipEvents used for Registering the Script to the correct Item/NPC/GameObject.
    
    CREDITS
    -- ArcEmu Dev Team (For creating ArcEmu)
    -- Blackboy0 (Editing all Comments)
    -- Kenuvis (SendPOI and FieldFlags)



    So try this

    function Vagabond_SS_Cast (pUnit, Event)
    pUnit:CastSpellOnTarget(27239, pUnit:GetRandomPlayer(10))
    end

    function Vagabond_SS (pUnit, Event)
    pUnit:RegisterEvent("Vagabond_SS_Cast",1000, 0)
    end

    RegisterUnitEvent (998158, 6, "Vagabond_SS")
    Last edited by kreegoth; 09-04-2008 at 08:53 PM.

  3. #3
    haphaz's Avatar Member
    Reputation
    8
    Join Date
    Oct 2006
    Posts
    14
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Kreegoth

    I see what you tried to do by adding 10 to the GetClosestPlayer() because of this:

    Code:
    CREATURE_EVENT_PLAYER_ENTERS_RANGE = 10,
    That's a mistake though. The GetClosestPlayer() function works just fine without any variables. The number 10 as you are thinking is used in registering unit events. I.E.
    RegisterUnitEvent (998158, 10, "Vagabond_SS_Cast")

    That doesn't seem to work though, unfortunately.

Similar Threads

  1. New LUA Scripts
    By 777devil777 in forum World of Warcraft Emulator Servers
    Replies: 8
    Last Post: 11-26-2007, 05:58 PM
  2. (Exploit) Soulstone-Exploit
    By Ajhuah in forum World of Warcraft Exploits
    Replies: 20
    Last Post: 11-19-2007, 07:21 PM
  3. Give entire raid a soulstone [re]
    By Lavi in forum World of Warcraft Exploits
    Replies: 14
    Last Post: 08-28-2007, 05:02 PM
  4. Give entire raid a soulstone
    By zenocide in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 08-27-2007, 08:18 PM
  5. Two or More Soulstones at Once
    By Matt in forum World of Warcraft Exploits
    Replies: 16
    Last Post: 01-30-2007, 07:02 AM
All times are GMT -5. The time now is 08:52 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