MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides  
Homepage Register FAQ Members Mark Forums Read Advertise Marketplace FPSowned


Go Back   MMOwned - World of Warcraft Exploits, Hacks, Bots and Guides > WoW Emulator Server > Emulator Server Guides > Antrix Guides
Reload this Page [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
Antrix Guides This section is for WoW emulated server, Antrix guides.
[NO QUESTIONS HERE]

 
 
LinkBack Thread Tools
[GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
(#1)
Old
Greed's Avatar
Greed is Offline
Kodo Master
Rep Power: 4
Reputation: 335
Greed is a jewel in the roughGreed is a jewel in the roughGreed is a jewel in the roughGreed is a jewel in the rough
 
Posts: 718
Join Date: Oct 2007
Location: Heroicwow.net
[GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc - 10-21-2007

DBCUtil: [Only registered and activated users can see links. ]
CSVED: [Only registered and activated users can see links. ]
:Links Provided by PvPede:
I WILL NOT be explaining what the code is, i will explain some parts of the code though!
Also I would like to apologize in advance for the messiness of teh code, the post is not wide enough
YOU MUST FIRST HAVE THE SOURCE CODE FOR ANTRIX, AND SOMETHING LIKE VISUAL STUDIO 2005 or 2003 otherwise you can't do this, I use Visual Studio so it will be based on that
Inside Visual Studio create a new C++ source file by going to file->new->file->c++ file->click open
save the file as NewScript inside the InstanceScripts Folder, and copy and paste this code
or
First make a text file in the InstanceScripts folder name it NewScript.cpp make sure it doesnt say NewScript.cpp.txt now open the file with notepad or whatever word processing tool you have and copy and paste this code
Code:
#include "StdAfx.h" //these are required otherwise it wont compile and just give you hundreads of errors
#include "Setup.h"
#define MOBNAME XXXXXX //You can change MOBNAME to Whatever you want, Make sure to keep it all capitals, the XXXXX can be changed to the mobs ID Number in the DB
#define SPELL1 XXXXXX //Samething here almost, change SPELL1 to Whatever you want, just keep it all capital and change the XXXXX to a spell number
#define SPELL2 XXXXXX //repeat for how many spells you want, for this tutorial im gonna keep it with 2
#define SPELLSOUND XXXXX //this is for when they cast a spell they say something you can get all the sound ids in the soundentries.dbc you can turn it into a .csv with a convertor
class MOBNAMEAI : public CreatureAIScript
{
public:
ADD_CREATURE_FACTRY_FUCNTION(MOBNAMEAI); // Make sure to change MOBNAMEAI to The Name next to class
SP_AI_Spell spells[2]; //where it says spells[2] you can change the 2 to however many spells you have
bool m_spellcheck[2]; //same thing as above you can change the 2 to however many spells you have
MOBNAMEAI(Creture *pCreature) : CreatureAIScript(pCreature)
{
nrspells = 2; //same as before change to 2 to however many spells you have
for(int i=0;i<nrspells;i++)
  {
   m_spellcheck[i] = false;
  }
spells[0].info = sSpellStore.LookupEntry(SPELL1); //change SPELL1 to the define you made it as
spells[0].targettype = TARGET_VARIOUS; //I will put all the targettypes at the end
spells[0].instant = true; //wether it is instant or not
spells[0].perctrigger = 16.0f; //how often the spell is cast
spells[0].attackstoptimer = 1000; //can't remember how this is handled
spells[0].soundid = SPELLSOUND; // you can either put a number here or just use your define
spells[0].speech = "You can make them say things when they cast spells by having text here!"; //text that the mob yells when they cast the spell
spells[1].info = sSpellStore.LookupEntry(SPELL2); //change SPELL2 to the name of your spell 2 thing
spells[1].targettype = TARGET_ATTACKING;
spells[1].instant = true;
spells[1].perctrigger = 9.0f;
spells[1].attackstoptimer = 2000;
spells[1].soundid = SPELLSOUND;
spells[1].speech = "You can make them say other things for different spells";
}
void OnCombatStart(Unit* mTarget)
{
_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Have some text here for when you aggro him he yells it");
_unit->PlaySoundToSet(XXXXXX); //change the XXXXXX to whatever number that is in the soundentries.dbc file
RegisterAIUpdateEvent(_unit->GetUInt32Value(UNIT_FIELD_BASEATTACKTIME));
}
void OnTargetDied(Unit* mTarget)
 {
if (_unit->GetHealthPct() > 0) // Hack to prevent double yelling (OnDied and OnTargetDied when creature is dying)
  {
int RandomSpeach;
sRand.randInt(1000);
RandomSpeach=rand()%2;
switch (RandomSpeach)
{
case 0: 
_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Have some text here for when he kills a player");
_unit->PlaySoundToSet(XXXXX); //change the XXXXXX to whatever number that is in the soundentries.dbc file
break;
case 1:
_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "if there are two sounds then put some text here");          
 _unit->PlaySoundToSet(XXXXX); //change the XXXXXX to whatever number that is in the soundentries.dbc file
break;
}
}
}
void OnCombatStop(Unit *mTarget)
 {
  _unit->GetAIInterface()->setCurrentAgent(AGENT_NULL);
  _unit->GetAIInterface()->SetAIState(STATE_IDLE);
  RemoveAIUpdateEvent();
 } //dont change any of this unless you know what your doing
void OnDied(Unit * mKiller)
 {
_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, "Have some text here for when he dies");
_unit->PlaySoundToSet(XXXXX); //change the XXXXXX to whatever number that is in the soundentries.dbc file
 
RemoveAIUpdateEvent();
 }
void AIUpdate()
 {
Timer = Timer + 1;
if (Timer == 200) //you cn change the number to whatever you want after the timer reaches that number it will cast the spell below it
{
 _unit->CastSpell(_unit, spells[0].info, spells[0].instant); //you can change the numbers to whatever spell you want
}
else
{
float val = sRand.rand(100.0f);
SpellCast(val);
}
} //leave the rest of it alone unless you know what your doing
void SpellCast(float val)
 {
if(_unit->GetCurrentSpell() == NULL && _unit->GetAIInterface()->GetNextTarget())
{
float comulativeperc = 0;
Unit *target = NULL;
for(int i=0;i<nrspells;i++)
{
if(!spells[i].perctrigger) continue;
 
if(m_spellcheck[i])
{
target = _unit->GetAIInterface()->GetNextTarget();
switch(spells[i].targettype)
{
case TARGET_SELF:
case TARGET_VARIOUS:
_unit->CastSpell(_unit, spells[i].info, spells[i].instant); 
break;
case TARGET_ATTACKING:
_unit->CastSpell(target, spells[i].info, spells[i].instant); 
break;
case TARGET_DESTINATION:
_unit->CastSpellAoF(target->GetPositionX(),target->GetPositionY(),target->GetPositionZ(), spells[i].info, spells[i].instant); 
break;
}
if (spells[i].speech != "")
{
_unit->SendChatMessage(CHAT_MSG_MONSTER_YELL, LANG_UNIVERSAL, spells[i].speech.c_str());
_unit->PlaySoundToSet(spells[i].soundid); 
}
m_spellcheck[i] = false;
return;
}
if(val > comulativeperc && val <= (comulativeperc + spells[i].perctrigger))
{
_unit->setAttackTimer(spells[i].attackstoptimer, false);
m_spellcheck[i] = true;
}
comulativeperc += spells[i].perctrigger;
}
}
}
protected:
 int nrspells;
 int Timer;
}; //DO NOT TOUCH ANYTHING HERE UNLESS YOU KNOW WHAT YOUR DOING!
void SetupMOBNAME(ScriptMgr * mgr)
{
 mgr->register_creature_script(MOBNAME, &MOBNAMEAI::Create); //change MOBNAME to the define you used, also change MOBNAMEAI to the one you used at the beginning
}
Now we aren't done yet we need to go into Setup.cpp and Setup.h
In Setup.cpp
Code:
//Where it says SetupTheMechanar(mgr); put SetupMOBNAME(mgr);
//Where MOBNAME = the define you used in the script so it wuld look like this
SetupTheMechanar(mgr);
SetupMOBNAME(mgr);
//Simple as that
Now for Setup.h
Code:
/*Find void SetupTheMechanar(ScriptMgr * mgr); and put void SetupMOBNAME(ScriptMgr * mgr); under it where MOBNAME = teh define you used in the script so it would look like this*/
void SetupTheMechanar(ScriptMgr * mgr);
void SetupMOBNAME(ScriptMgr * mgr);
Now we need to add our file to the project Inside visual studio open up the InstanceScripts2005.vcproj or InstanceScripts2003.vcproj
then click the + next to the project and right click the folder called scripts and put your cursor over to add and click existing item, navigate to the InstanceScripts folder, double click on NewScript.cpp and badda bing your done with that
Now just compile and replace the InstanceScripts.dll in your script_bin folder for your server with the one in teh bin, script_bin folder!
Here are all the targettypes
Code:
TARGET_SELF,
TARGET_VARIOUS,
TARGET_ATTACKING,
TARGET_DESTINATION,
TARGET_SOURCE,
This Tutorial has been made by: Reknown



Donate to remove ads.
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
(#2)
Old
Gandair is Offline
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 3
Gandair is an unknown quantity at this point
 
Posts: 32
Join Date: Sep 2007
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc - 10-21-2007

This post makes me wish I were smarter =(. I'd love to get into this stuff someday.
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
(#3)
Old
halolouie is Offline
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 1
halolouie is an unknown quantity at this point
 
Posts: 21
Join Date: Oct 2007
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc - 10-27-2007

very nice well explained +rep
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
(#4)
Old
destroyah is Offline
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 0
Reputation: 1
destroyah is an unknown quantity at this point
 
Posts: 1
Join Date: Oct 2007
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc - 11-01-2007

excuse me but where can i find the antrix source?
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
(#5)
Old
Arthas117's Avatar
Arthas117 is Offline
Contributor
Rep Power: 2
Reputation: 142
Arthas117 will become famous soon enoughArthas117 will become famous soon enough
 
Posts: 448
Join Date: Mar 2007
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc - 11-02-2007

now I wish i was a smartass programmer of antrix..don't understand a shit
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc
(#6)
Old
Tazjin's Avatar
Tazjin is Offline
Corporal
Rep Power: 2
Reputation: 39
Tazjin is on a distinguished road
 
Posts: 30
Join Date: Jul 2007
Re: [GUIDE] - Scripting for Antrix, Making Mobs Talk, Cast Spells, etc - 11-14-2007

Well, I already knew that but its VERY great for beginners.

+rep


[Only registered and activated users can see links. ]
(#7)
Old
csearle1 is Offline
Site n00b.. (A leecher if I've been here for more than a month and can't earn 5 rep)
Rep Power: 2
Reputation: 1
csearle1 is an unknown quantity at this point
 
Posts: 11
Join Date: Dec 2007
12-10-2007

Nice job. been searching for one of these specifically
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are On



Powered by vBulletin® Version 3.7.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vBulletin Skin developed by: vBStyles.com


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382