[GUIDE]Through the Database [MOB SCRIPTING] menu

User Tag List

Results 1 to 9 of 9
  1. #1
    Lonehwolf's Avatar Member
    Reputation
    15
    Join Date
    Sep 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [GUIDE]Through the Database [MOB SCRIPTING]

    So you made a server, put in some custom mobs, and now you feel like giving them some "intelligent" functionality... Maybe make them to fry the player's arse or punt them away?

    Well, it's possible with MaNGOS as well. The key?

    ACID and ScriptDev2.

    Now I'm skipping the explanation of the above to type it in further below, but since most people just want to speed it all up and get going, it's essential that you have your SD2 installed and configured correctly. Other guides covered that thoroughly so no need to repeat.

    What I'll be tackling, is the simpler, database-related scripting of mobs.

    Pros and Cons to it:
    -It's fairly straight forward.
    -It's lightweight and avoids compiling and such.

    -It lacks the reload functionality. So restarting the server is still a requirement.
    -It's not too comprehensive. Scripting simple mobs is fine, bosses... ScriptDev2 is there for that.

    Basic Setup:
    Knowing the limitation of ACID, aka Database Mob Scripting, it's time to get started on the basics to scripting it.

    Let's start with what you'll want:

    -A mob.
    -The EventAI_Scripts table inside the Scripting Database (used by SD2)
    -Stay sober. Please - Do it. If you get drunk at this step you'll end up in quite some trouble to figure out how to undo what you did and redo it the right way.


    Let's start off by considering the first basic entry of a mob, at ID "60k". We'll make it so that it makes use of the mob_eventai script.

    UPDATE `DATABASENAME`.`creature_template` SET `ScriptName` = 'mob_eventai' WHERE `creature_template`.`entry` =CREATUREID LIMIT 1 ;
    DATABASENAME: The name of your WORLD Database.
    CREATUREID: The Creature to whom you'll bind this script to.

    So now we configured the mob to make use of the scripts table. What's left for us is to make the mob cast da frigging spell

    Now this is the complicated part. And it will require some playing around with, I personally spend 2 days working and testing possible outcomes, so don't expect to pull it off in one go. SD2 have their own IRC where you can pop in and ask questions there, but I'll leave searching that to you

    So we're stuck with building the mob itself. This is where your head spins with all the values and such. I recommend this website to acquiring the general layout: Event AI Creator for UDB

    Once you grab the SQL file, run through it and check if it's all fine or not. I'm guiding you through a simple spell for a mob at id "60k" in the following quote:

    /*60k Mob Frostbolt Rank 5*/
    INSERT INTO `itagback_mfs`.`eventai_scripts` (`id`, `creature_id`, `event_type`, `event_inverse_phase_mask`, `event_chance`, `event_flags`, `event_param1`, `event_param2`, `event_param3`, `event_param4`, `action1_type`, `action1_param1`, `action1_param2`, `action1_param3`, `action2_type`, `action2_param1`, `action2_param2`, `action2_param3`, `action3_type`, `action3_param1`, `action3_param2`, `action3_param3`, `comment`)
    VALUES ('87000', '60000', '0', '0', '70', '1', '10', '20', '9000', '12000', '11', '16766', '1', '3', '0', '0', '0', '0', '0', '0', '0', '0', '60kMob Frostbolt');
    Ok let's break it down quickly.
    - The First Value is what SQL always asks you for, and ID to identify that particular script entry. Keep it unique.
    - The second value is the mob you're binding this to. Make sure it's correct, it can be duplicate if you're adding more than one event.
    - Now the Event_Type is set to 0 which indicates a TIMED EVENT.
    - Phase Mask is slightly more advanced so we're skipping on that.
    - Event Chance is how possible is it for that event to take place? The value is percentage, do NOT include the % sign. 100 indicates an action which will trigger, 70 means it will occur slightly more oftenly than twice every 3 times. Etc.
    -The Event_Flags is set to 1. This indicates it's repeatable.
    -The next 4 values are the event parameters. Since our event is a TIMED EVENT, they are: MinTime, MaxTime, MinRepeat, MaxRepeat. They are in MILLISECONDS, thus 1000 = 1s. The event will trigger nearly immediately upon the mob entering combat. It will repeat the spell every 9 to 12 seconds.

    The next values are the Action Values. Each entry is based on an EVENT. Once the event triggers, you're allowed to setup at most 3 actions.

    I've only inputted one action in this case, that is to make it cast a spell. Each action has the Action_Type and 3 parameters.

    In this case, the Action Type is "11" which indicates CAST.
    The First Paramater is set to "1" This is the target type. Aka Hostile Player that the mob is focusing its attacks on.

    The Second paramater holds the CAST FLAGS in the case of a CAST action.
    I set it to three which basically interrupts any previous spell, and triggers the spell, even if the mob is lacking mana or particular reagants.


    Now the question must be in your head by now:

    How the **** do you know all that? The answer is the documentation. It explains what each field is for and what you can input in it.

    Where to find the Documentation? Well, hoping you installed SD2 correctly, it's in there. It's a text file called EventAI.txt A quick search in the SVN should make it pop up.

    I understand it's not the nicest-looking guide, and your eyes may be all messed up by now, but I just wanted to build a guide for getting people off on scripting, since most people end up staring at how to start off mob scripting and eventually give up.

    Let me know if you have questions, and make sure you follow the Documentation to building your setups.
    Last edited by Lonehwolf; 04-10-2009 at 07:51 AM.

    [GUIDE]Through the Database [MOB SCRIPTING]
  2. #2
    Lonehwolf's Avatar Member
    Reputation
    15
    Join Date
    Sep 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'm guessing nobody liked this? =/

  3. #3
    Henkke's Avatar Member
    Reputation
    26
    Join Date
    Sep 2008
    Posts
    287
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    It's nicely made guide, but the audience in here might be a little low since all the repack users and simple lua guys, anyways rep for taking time and writing this.

  4. #4
    resinate's Avatar Member
    Reputation
    3
    Join Date
    May 2008
    Posts
    29
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    well with the new eventAI they elimated scriptdev2 and now u cant use custom Ai in instance or raid maps only outdoor maps now.

    i want script dev back so badly now the new eventAI system was built by a retard

  5. #5
    Lonehwolf's Avatar Member
    Reputation
    15
    Join Date
    Sep 2008
    Posts
    54
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Technically, using the Normal or Heroic flags, you should be able to script for instances as well. At least it works for us

    Btw, SD2 ain't dead. In fact, it's functioning to the maximum. Since ACID is far simpler to use, they wanted to migrate as many simple scripts as possible over to it. SD2 is mainly used for more complicated boss events.

    Wolf.
    P.S. Thanks for rep, no longer a leecher

  6. #6
    Synginn75's Avatar Member
    Reputation
    1
    Join Date
    May 2009
    Posts
    1
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Nice guide, Was just looking for different ways to manipulate my server when I saw this guide.....awesome

  7. #7
    Rayuski's Avatar Member
    Reputation
    3
    Join Date
    May 2009
    Posts
    32
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    guide

    great guide

  8. #8
    Jokera's Avatar Member
    Reputation
    1
    Join Date
    Sep 2006
    Posts
    4
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very good explained guide!

  9. #9
    Dibes's Avatar Active Member
    Reputation
    18
    Join Date
    May 2008
    Posts
    47
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    THIS IS AWESOME +rep!!!

Similar Threads

  1. Replies: 1
    Last Post: 03-27-2010, 05:47 PM
  2. Guide: Allowing Remote Access to the database *VIDEO/Written*
    By Jgro1413 in forum WoW EMU Guides & Tutorials
    Replies: 1
    Last Post: 03-04-2009, 03:10 PM
  3. [Guide] Setting Up The Database Importer Tool
    By SectorSeven in forum WoW EMU Guides & Tutorials
    Replies: 0
    Last Post: 02-29-2008, 12:53 AM
  4. [Guide]How to give permission to remote acces the database [Navicat]
    By Knife in forum WoW EMU Guides & Tutorials
    Replies: 3
    Last Post: 01-26-2008, 02:28 AM
All times are GMT -5. The time now is 12:00 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