KeizerHalil
11-12-2007, 06:20 PM
Well, I have seen a lott of tutorials on ac-web, but none of them were for us noobs. Well I searched for a clear explenation and found this guide!
Here is a complete guide of the Scarlet Monastary Boss!
Part 1: Naming Conventions
In addition to adhering to the Game Monkey scripting procedure I�d like to define a set of coding standards and naming procedures to make multi-programmer development as easy as possible. All of these rules are simple and code must meet them before it is committed to the SVN.
1. Name of file: Instance_language_name_wing_mobs.gm
2. Function names: Boss_Spell_Type_Target
3. Variable names
4. Initiating and Completing of boss fight
5. Naming of Bosses in Comments
----------------------------------------------------------------------------------------
1. Name of file: Instance_language_name_wing_type.gm
Having "instance" at the start keeps all our files together, regardless of folder structure used by different DBs etc.
Placing "en/fr/de" in the string allows us to have multi-lingual versions of our scripts side by side.
By separating instances down to 'wings' we can have multiple people working on multiple instances at the same time, without any code merging (less chance of issues).
By stating what 'type' offile it is, allows us to sage our development from Boss then mobs then effects (ZG gong effect) etc. Again, allowing mutiple developers to work on the same projects with little chance of cross-over.
e.g.
Code:
instance_en_scarlet_monastery_cathedral_boss.gm
or instance_fr_scholomance_mob.gm
2. Function names: Boss_Spell_Type_Target
Function names sould be capitalised with all words separated by and underscore. Spells should be marked clearly, type should include the effect and target should label who it effects (AoE, highest threat, random, caster etc)
e.g.
code:
global Arcanist_Doan_Fire_Aoe = function(mob,plr)
or global Solakar_Warstomp_Stun_Aoe (mob,plr)
3. Variable names
Variable names should follow the same convention as Function Names and be a clear description of what it is.
e.g.
Code:
global Van_Cleef_Phases
or global Mister_Smite_Phase
4. Initiating and Completing of boss fight
Function names should have the following appended:
_On_Combat_Enter
_On_Combat_Leave
_On_Death_Self
_On_Death_Mob (change 'Mob' for the mobs name)
_On_Death_Player
e.g.
Code:
global General_Drakkisath_On_Combat_Enter = function(mob, plr)
{
}
I know this is a bit of a pain, but there are so many ways of declaring this that people write currently (agro, on aggro, start combat, enter combat, fight etc.) that standardising this will make code quicker to edit :)
5. Naming of Bosses in Comments
Another thing that may seem a bit like overkill.
But it allows us to check the actual GM code against the spells/timers at a glance.
Anyway, the comments are written before the Boss is coded, which is the main advantage of the agile approach we're taking.
e.g.
Code:
// ***********************************************
// SCARLET MONASTERY
// Cathedral
//
// Houndmaster Loksey (3974)
//
//
// Spell List
// * CURSEOFAGONY - 18671 | Every 18 seconds
// * SHADOWSHOCK - 20603 | Every 9 seconds
// * Dominate Mind - 20604 | Every 60 seconds
// * FEAR - 6215 | Every 45 seconds
//
//
// Talk List
// * "Release the hounds" | On Combat Enter
// * "Bugger - I've died" | On Combat Leave
//
// ***********************************************
For a list of all the recent commands go to this link:
http://ascent-scripts.com/forum/showthread.php?tid=6
A fully completed Script
Code:
//************************************************** ****************/
//
// ASCENT-SCRIPTS.COM
//
// Working WITH the ascent community FOR the community
//
//
// Instance Name: SCARLET MONASTERY
// Instance Wing: Cathedral
// Instance Type: Boss
//
//
//
// With Our Thanks
// _______________
//
// Original Code Submitted By: NCDB 1.0
// On: 1st January 2009
//
//
// Community Contributors: Names of EVERYONE
// Who helped with code
// On this file
//
//
// Alpha : AuthorName 1st October 2009
// Beta : AscentScripts 2nd October 2009
// Person2
// Person3
// Release : AscentScripts 5th October 2009
//
//
//
//
// Outstanding Issues
// __________________
//
// Arcanist Doan:
//
// Fire AoE is wrong as it stuns players. Spell needs to be changed.
// He does an Arcane Explosion at some stage, need a retail verification.
//
//
// Houndmaster Loksey:
//
// He plays a sound on_combat_enter. i've no idea what it is.
//
//
//
//************************************************** ****************/
//************************************************** ****************/
// SCARLET MONASTERY
// Cathedral
//
// Arcanist Doan (6487)
//
//
// Spell List
//
// * Fire Based AoE : 13020 : Every 30 seconds
// * Polymorph : 33173 : Every 40 seconds - Random target
// * Suppression Silence AoE : 35892 : Every 50 seconds
//
//
// Talk List
//
// * "Burn in righteous fire!" : On Cast Fire AoE
//
//
// Yell List
//
// * "You will not defile these mysteries!" : On Combat Enter
//
//
//************************************************** ****************/
global Arcanist_Doan_Fire_Aoe = function(mob,plr)
{
.SendChatMessage("Burn in righteous fire!");
.CastSpell(13020); // Cast Fire AoE
};
global Arcanist_Doan_Polymorph = function(mob,plr)
{
plr = .GetRandomPlayer();
if(plr != null)
{
.CastSpellOnTarget(12826, plr); // Cast Polymorph
}
};
global Arcanist_Doan_Suppression_Silence_Aoe = function(mob,plr)
{
.CastSpell(35892); // Cast Suppression
};
global Arcanist_Doan_On_Combat_Enter = function(plr)
{
.RegisterTimer(29000, Arcanist_Doan_Fire_Aoe, 0);
.RegisterTimer(41000, Arcanist_Doan_Polymorph, 0);
.RegisterTimer(52000, Arcanist_Doan_Suppression_Silence_Aoe, 0);
.SendChatMessage("You will not defile these mysteries!");
};
//************************************************** ****************/
// SCARLET MONASTERY
// Cathedral
//
// Houndmaster Loksey (3974)
//
//
//
// Spell List
//
// * Enrage : 39249 : At 25% health
//
//
// Yell List
//
// * "Release the hounds" : On Combat Enter
//
//
//************************************************** ****************/
global Hound_Master_Loksey_Health_Check = function(mob,plr)
{
if(.GetHealthPct() <= 25) // Check Health is under 25%
{
.CastSpell(39249); // Cast Enrage
}
};
global Hound_Master_Loksey_On_Combat_Enter = function(plr)
{
.RegisterTimer(1000, HoundMaster_Loksey_Health_Check, 0); // Check health every second
.SendYellMessage("Release the hounds!");
};
//************************************************** ****************/
//
// Registering events
//
//************************************************** ****************/
this.RegisterUnitEvent(6487, 1, Arcanist_Doan_On_Combat_Enter); // Arcanist Doan enters combat
this.RegisterUnitEvent(3974, 1, Hound_Master_Loksey_On_Combat_Enter); // Hound Master Loksey enters combat
//************************************************** ****************/
//
// Copyright (C) 2007 Ascent-Scripts
// www.ascent-scripts.com
// svn://emupedia.com/svn/ascent-scripts
//
//
// Credit to the creators and contributors of this file MUST be
// included at all times, even if modified by another party.
//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//************************************************** ****************/
Here is a complete guide of the Scarlet Monastary Boss!
Part 1: Naming Conventions
In addition to adhering to the Game Monkey scripting procedure I�d like to define a set of coding standards and naming procedures to make multi-programmer development as easy as possible. All of these rules are simple and code must meet them before it is committed to the SVN.
1. Name of file: Instance_language_name_wing_mobs.gm
2. Function names: Boss_Spell_Type_Target
3. Variable names
4. Initiating and Completing of boss fight
5. Naming of Bosses in Comments
----------------------------------------------------------------------------------------
1. Name of file: Instance_language_name_wing_type.gm
Having "instance" at the start keeps all our files together, regardless of folder structure used by different DBs etc.
Placing "en/fr/de" in the string allows us to have multi-lingual versions of our scripts side by side.
By separating instances down to 'wings' we can have multiple people working on multiple instances at the same time, without any code merging (less chance of issues).
By stating what 'type' offile it is, allows us to sage our development from Boss then mobs then effects (ZG gong effect) etc. Again, allowing mutiple developers to work on the same projects with little chance of cross-over.
e.g.
Code:
instance_en_scarlet_monastery_cathedral_boss.gm
or instance_fr_scholomance_mob.gm
2. Function names: Boss_Spell_Type_Target
Function names sould be capitalised with all words separated by and underscore. Spells should be marked clearly, type should include the effect and target should label who it effects (AoE, highest threat, random, caster etc)
e.g.
code:
global Arcanist_Doan_Fire_Aoe = function(mob,plr)
or global Solakar_Warstomp_Stun_Aoe (mob,plr)
3. Variable names
Variable names should follow the same convention as Function Names and be a clear description of what it is.
e.g.
Code:
global Van_Cleef_Phases
or global Mister_Smite_Phase
4. Initiating and Completing of boss fight
Function names should have the following appended:
_On_Combat_Enter
_On_Combat_Leave
_On_Death_Self
_On_Death_Mob (change 'Mob' for the mobs name)
_On_Death_Player
e.g.
Code:
global General_Drakkisath_On_Combat_Enter = function(mob, plr)
{
}
I know this is a bit of a pain, but there are so many ways of declaring this that people write currently (agro, on aggro, start combat, enter combat, fight etc.) that standardising this will make code quicker to edit :)
5. Naming of Bosses in Comments
Another thing that may seem a bit like overkill.
But it allows us to check the actual GM code against the spells/timers at a glance.
Anyway, the comments are written before the Boss is coded, which is the main advantage of the agile approach we're taking.
e.g.
Code:
// ***********************************************
// SCARLET MONASTERY
// Cathedral
//
// Houndmaster Loksey (3974)
//
//
// Spell List
// * CURSEOFAGONY - 18671 | Every 18 seconds
// * SHADOWSHOCK - 20603 | Every 9 seconds
// * Dominate Mind - 20604 | Every 60 seconds
// * FEAR - 6215 | Every 45 seconds
//
//
// Talk List
// * "Release the hounds" | On Combat Enter
// * "Bugger - I've died" | On Combat Leave
//
// ***********************************************
For a list of all the recent commands go to this link:
http://ascent-scripts.com/forum/showthread.php?tid=6
A fully completed Script
Code:
//************************************************** ****************/
//
// ASCENT-SCRIPTS.COM
//
// Working WITH the ascent community FOR the community
//
//
// Instance Name: SCARLET MONASTERY
// Instance Wing: Cathedral
// Instance Type: Boss
//
//
//
// With Our Thanks
// _______________
//
// Original Code Submitted By: NCDB 1.0
// On: 1st January 2009
//
//
// Community Contributors: Names of EVERYONE
// Who helped with code
// On this file
//
//
// Alpha : AuthorName 1st October 2009
// Beta : AscentScripts 2nd October 2009
// Person2
// Person3
// Release : AscentScripts 5th October 2009
//
//
//
//
// Outstanding Issues
// __________________
//
// Arcanist Doan:
//
// Fire AoE is wrong as it stuns players. Spell needs to be changed.
// He does an Arcane Explosion at some stage, need a retail verification.
//
//
// Houndmaster Loksey:
//
// He plays a sound on_combat_enter. i've no idea what it is.
//
//
//
//************************************************** ****************/
//************************************************** ****************/
// SCARLET MONASTERY
// Cathedral
//
// Arcanist Doan (6487)
//
//
// Spell List
//
// * Fire Based AoE : 13020 : Every 30 seconds
// * Polymorph : 33173 : Every 40 seconds - Random target
// * Suppression Silence AoE : 35892 : Every 50 seconds
//
//
// Talk List
//
// * "Burn in righteous fire!" : On Cast Fire AoE
//
//
// Yell List
//
// * "You will not defile these mysteries!" : On Combat Enter
//
//
//************************************************** ****************/
global Arcanist_Doan_Fire_Aoe = function(mob,plr)
{
.SendChatMessage("Burn in righteous fire!");
.CastSpell(13020); // Cast Fire AoE
};
global Arcanist_Doan_Polymorph = function(mob,plr)
{
plr = .GetRandomPlayer();
if(plr != null)
{
.CastSpellOnTarget(12826, plr); // Cast Polymorph
}
};
global Arcanist_Doan_Suppression_Silence_Aoe = function(mob,plr)
{
.CastSpell(35892); // Cast Suppression
};
global Arcanist_Doan_On_Combat_Enter = function(plr)
{
.RegisterTimer(29000, Arcanist_Doan_Fire_Aoe, 0);
.RegisterTimer(41000, Arcanist_Doan_Polymorph, 0);
.RegisterTimer(52000, Arcanist_Doan_Suppression_Silence_Aoe, 0);
.SendChatMessage("You will not defile these mysteries!");
};
//************************************************** ****************/
// SCARLET MONASTERY
// Cathedral
//
// Houndmaster Loksey (3974)
//
//
//
// Spell List
//
// * Enrage : 39249 : At 25% health
//
//
// Yell List
//
// * "Release the hounds" : On Combat Enter
//
//
//************************************************** ****************/
global Hound_Master_Loksey_Health_Check = function(mob,plr)
{
if(.GetHealthPct() <= 25) // Check Health is under 25%
{
.CastSpell(39249); // Cast Enrage
}
};
global Hound_Master_Loksey_On_Combat_Enter = function(plr)
{
.RegisterTimer(1000, HoundMaster_Loksey_Health_Check, 0); // Check health every second
.SendYellMessage("Release the hounds!");
};
//************************************************** ****************/
//
// Registering events
//
//************************************************** ****************/
this.RegisterUnitEvent(6487, 1, Arcanist_Doan_On_Combat_Enter); // Arcanist Doan enters combat
this.RegisterUnitEvent(3974, 1, Hound_Master_Loksey_On_Combat_Enter); // Hound Master Loksey enters combat
//************************************************** ****************/
//
// Copyright (C) 2007 Ascent-Scripts
// www.ascent-scripts.com
// svn://emupedia.com/svn/ascent-scripts
//
//
// Credit to the creators and contributors of this file MUST be
// included at all times, even if modified by another party.
//
//
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
//
//************************************************** ****************/