[Guide] How to make Gameobject Traps menu

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 15 of 20
  1. #1
    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)

    [Guide] How to make Gameobject Traps

    Hello there :wave:

    In my spare time I have managed to struggle together a small guide on how to make a few tricks, they could be used in custom instances, around the world, or anything your imagination can come up with!

    The first one I will tell you can be a trap of used as a event. What will happen is when a player uses (right clicks) the gameobject we use, npc's can spawn anywhere on the same map for any amount of time as any faction. For example, somone opens a gate and 3 minions spawn + a boss at the back of the room for 5mins, and you have to kill him before he despawns! It could be a trap where you click on a chest and 2 npc's spawn ready to guide the treasures!

    Here is the script:


    Code:
    function zzzGameobjectTrap_onUse (pUnit, Event)
    
    pUnit:SpawnCreature (IDOfCreature, x, y, z, o, faction, duration) end RegisterGameObjectEvent (IDofGameobject, 2, "zzzGameobjectTrap_onUse")

    The bits in red we are going to need to change:



    IDOfCreature, change to the id of the npc you want to spawn.



    x, In game where you want the npc to spawn type ".gps", this will tell you the map, x, y, z, o, zone etc.



    y, Same as above



    z, Same as above but add 1-2 to the number



    o, Is which way the npc is going to spawn, so make sure your facing the right way when you do ".gps"



    IDOfGameobject, is the ID of the gameobject you want to spawn the npc's when we use it. The type MUST be 10 or it will not work.



    We now put that into a notepad, then saveas, all files, "whateveryouwanttocallit.lua" then put it in your scripts folder and restart your server.



    With that script you can spawn as many creatures as you want, so if i wanted more than one i would type:




    Code:
    function zzzGameobjectTrap_onUse (pUnit, Event)
    
    pUnit:SpawnCreature (IDOfCreature, x, y, z, o, faction, duration) pUnit:SpawnCreature (IDOfCreature, x, y, z, o, faction, duration)
    pUnit:SpawnCreature (IDOfCreature, x, y, z, o, faction, duration) pUnit:SpawnCreature (IDOfCreature, x, y, z, o, faction, duration)
    end RegisterGameObjectEvent (IDofGameobject, 2, "zzzGameobjectTrap_onUse")

    Note - Try to use the same script for one map, if you use the same script for a second place it wont work as the register and function is the same. Change them.



    Code:
    zzzGameobjectTrap



    -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



    For my second trick, I am going to tell you how to make a gameobject cast a spell when you click on it. This does not require a script.

    This can be used to create buffs or mid-fight tactics inside custom instances (anti magic shield etc), or just a catapult for example (knockback).





    Steps:



    1: Create a gameobject with any id (This will be used to spawn it)



    2: Make the type 22



    3: Name of what players will see when they hover there mouse over it.



    3: Make the displayid of what you want it to look like (259 for a chest)



    4: Spell Focus is the id of the spell we want it to cast. Some spells may not work, for example i will do "5" Which will kill the player instantly.



    Your done, restart server and do .gobject spawn (id of your gameobject)



    Note - Some spells can be abused, for example on some servers (not all) if you put 5, and the player clicks on another player than uses the chest it will kill the other player not him, so be warned.




    Thankyou for reading this post!
    Please comment!


    Edit: Ignore the code box mistakes and issues, i cant get it any better, gah!
    Last edited by stoneharry; 09-16-2008 at 11:12 AM.

    [Guide] How to make Gameobject Traps
  2. #2
    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)
    30 views, 0 reply's.......

  3. #3
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    nice tutorial, simple and useful. +rep Stoneharry i have a question. I´ve made a simple gameobject script to summon a npc at the player who clicked the gameobject position. here´s the code:

    function footmanarmy_OnUse(pUnit,event)

    x = pUnit:GetX();
    y = pUnit:GetY();
    z = pUnit:GetZ();
    o = pUnit:GetO();

    pUnit:SpawnCreature(17257, x, y, z, o, 80, 43200000);
    end
    RegisterGameObjectEvent(1000084, 2, "footmanarmy_OnUse");

    is something wrong with my code? I´ve made the script with notepad, changed the extension of it to .lua and had saved it in the scripts folder in my "Scripted's 2.4.3 Blizzlike Repack" (can´t remember who made it). The gameobject in question its a gameobject with id 1000084 and its a button (code 1 in mysql) and still the script doesn´t work when i click it in game. What´s possibly could be wrong? It´s because it hasn´t been loaded in the arc-emu world.exe when i open the server? What can i do to make it be loaded?

  4. #4
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a observation, before you guys tell me this will summon magtheridon instead of a footman and that the time for it to despawn its huge. This is just a test script, if it work i´ll change it, but why it doesn´t work?

  5. #5
    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)
    Did you put it into your "scripts" folder?
    At the moment thats going to spawn it where you spawned the gameobject, but i am not 100% sure you can get coords as a gameobject, so if it's saying "load failed" or "error at line 32" bla bla bla, something like that, it's because you cant get coords probably. Make sure the obejct's type is 10.

    Also don't double post, edit the first one.

    And i didn't think leechers could rep

  6. #6
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    yeah its in scripts folder. It doesn´t give me any message in the game. I open arc-emu logonserver.exe, then arc-emu world.exe. I´m not sure if this script is loaded when i open arc-emu world.exe. I login then i spawn the gameobject in game and click it. Nothing happens, no messsage, no spawn, nothing. I´ve changed the type of gameobject to 10 im mysql as you´ve said, nothing happens again. This thing is really annoying me, this should have worked a long time ago. Do you have any other sugestions for this? i just want a script that when i click a game object a npc is summoned at the player position.
    Last edited by orco6; 09-17-2008 at 03:35 PM.

  7. #7
    Jodeath's Avatar Member
    Reputation
    41
    Join Date
    Oct 2007
    Posts
    55
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lesson learned, do not give chair a spell effect...

  8. #8
    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)
    Originally Posted by Jodeath View Post
    lesson learned, do not give chair a spell effect...
    huh? :confused:

    also, orc06, make sure you have Lua enabled. I think thats probably it, search a guide if you don't know how to

  9. #9
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks a lot man! Half problem solved! if it would serve for anything i would give you an entire page of +Rep lol. Now another annoyance, i open arc-emu world.exe and it loads a lot of lua scripts that was already at my repack when i had downloaded it. All of them except my script! How can i add my script to the luascripts.dll at the scripts_bin folder? (I supposed that´s the next step isn´t?) Any idea? and thanks a lot for the help man

  10. #10
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    How does it not load it? Is it in red text?

  11. #11
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Forget what i´ve said about not being loaded, it was because i´ve saved the text in unicode, it only loads when its saved in ansi. But even my script being loaded when i spawn the gameobject in game and click it nothing happens, no spawn, no message is given and that´s the most strange thing i observe in all this mess. What the... could be wrong? The code isn´t right? The script isn´t being loaded? yes it is at least most of people say isn´t wrong. Some even gave me another code more well made:

    function footmanarmy_OnUse(pUnit,event)

    local x = pUnit:GetX();
    local y = pUnit:GetY();
    local z = pUnit:GetZ();
    local o = pUnit:GetO();

    pUnit:SpawnCreature(17211, x , y , z, o, 80, 43200000);
    end

    RegisterGameObjectEvent(1000084, 2, "footmanarmy_OnUse");

    but even with this script being loaded correctly nothing happens when i spawn the gameobject in game and click it, and the most strange thing is that no message is given in game or in the console. I´ve changed the type of the gameobject to 10 (goober) as you´ve told me stoneharry. Should i change it again to 1 (button)? Why can´t you just work right script? Why can´t you just do what you´re supposed to? and why can´t you give me any message of what´s not working in your code huh? HUH?!! Sorry. :yuck:

  12. #12
    Sounddead's Avatar Contributor
    Reputation
    160
    Join Date
    Sep 2007
    Posts
    1,126
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you changed console logging to 3?

  13. #13
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Console logging? hmmm no. I didnt knew i had to change it. Where can i do this? Thanks for the help sounddead Now i´ve found how to change it hehe the only message the console gave me was this: World: CSMG_GAMEOBJ_USE: [GUID 1] thats all, no spawn.
    Last edited by orco6; 09-19-2008 at 08:02 AM.

  14. #14
    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)
    ok, lets go over a lot. First then your armemu-config or whatever, and find this:

    Code:
     
    <ScriptBackends LUA="0"
    AS="0">
    Change it to:

    Code:
     
    <ScriptBackends LUA="1"
    AS="1">
    Next step, copy and paste your script into a new text document, change it from a text document, to all files. Then call the script zzztest.lua

    the .lua is important.

    Once you have done that drag drop the lua into your "Scripts" folder in arcemu. Not scripts_bin, Scripts.

    Now restart your server, when it gets near to the end of loading up arcemu-world.exe it will load dll's (in script_bin) then it will load lua's (scripts) and it will say each Lua file then if it loaded properly. e.g

    Code:
    zzztest.lua.... Loaded,
    Now if that works, fantastic! respawn the gameobject and see if it works... If it still doesn't work then try changing the flags to lots of different things, 1, 3, etc... It's probably a different database format.

    If you got a error when loading, tell me what the error was.

    Good Luck

    Edit: It may also be because your repack or whatever does not support the Lua commands required. Try compiling Lua again, Or get a newer repack.

  15. #15
    orco6's Avatar Member
    Reputation
    1
    Join Date
    Apr 2008
    Posts
    26
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks for all the help man i think the problem is my repack, did all you told me. Im gonna dl a new one, + rep for you, if i could give more now i would but have to wait 24h.

Page 1 of 2 12 LastLast

Similar Threads

  1. [Guide] How to make any Race be any Class and play it
    By Illidan1 in forum WoW EMU Guides & Tutorials
    Replies: 51
    Last Post: 03-19-2008, 08:32 PM
  2. [Guide] How to make a account creation page! Very easy!! (Hamachi)
    By rfvtgbyhn in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 11-02-2007, 05:25 PM
  3. [Guide]How to make your Server 2.2.0 !
    By Guysus in forum WoW EMU Guides & Tutorials
    Replies: 17
    Last Post: 10-02-2007, 05:10 PM
  4. Guide how to make TWINK PRIEST
    By Croat in forum World of Warcraft Guides
    Replies: 8
    Last Post: 04-29-2007, 08:18 AM
  5. *Guide* How to make a movie
    By djmazi in forum World of Warcraft Guides
    Replies: 5
    Last Post: 12-22-2006, 09:15 PM
All times are GMT -5. The time now is 05:29 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