This is a read only copy without any forum functionality of the old Modcraft forum.
If there is anything that you would like to have removed, message me on Discord via Kaev#5208.
Big thanks to Alastor for making this copy!

Menu

Author Topic: [QUESTION]script for creature like scourge skydarkener  (Read 3290 times)

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
[QUESTION]script for creature like scourge skydarkener
« on: June 04, 2013, 02:25:03 am »
is there a way to make a creature script like the script in scourge sky darkener in dk quest line that shoot an invisble target far away srry for my english :lol:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #1 on: June 04, 2013, 03:42:24 pm »
Yes. There is a invisible display ID - spawn a creature with that, give it the untargetable flags on the bitmask, and then have your npc cast a spell on it.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #2 on: June 05, 2013, 02:00:21 am »
i know and i did that but i want the npc to shoot far far far out of range npc and out of aggro too like the sky darkener he shooot the sky darkener target even if it out off aggro range and thx for the reply mate
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

stoneharry

  • Contributors
  • Creator of Worlds
  • *****
  • Posts: 617
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #3 on: June 05, 2013, 08:39:33 am »
Quote from: "raeef"
i know and i did that but i want the npc to shoot far far far out of range npc and out of aggro too like the sky darkener he shooot the sky darkener target even if it out off aggro range and thx for the reply mate

You can cast at GPS coordinates of unlimited range, if you send the necessary packets.

A code snippet for a command I added:
Code: [Select]
bool ChatHandler::HandleCastAOECommand(const char *args, WorldSession *m_session)
{
Unit *u = getSelectedUnit(m_session, false);
if(!u)
u = m_session->GetPlayer();
uint32 spell = 0;
uint32 triggered = 0;
float x,y,z = 0.0f;
if( sscanf(args, "%u %f %f %f %u", &spell, &x, &y, &z, &triggered) != 5)
if(sscanf(args, "%u %u", &spell, &triggered) != 2)
return false;
if(x == y)
{
if(u = getSelectedUnit(m_session, false))
{
x = u->GetPositionX();
y = u->GetPositionY();
z = u->GetPositionZ();
}
else
return false;
}
SpellEntry* sp = dbcSpell.LookupEntryForced(spell);
if(!sp)
{
SystemMessage(m_session, "Invalid spell %u", spell);
return true;
}
m_session->GetPlayer()->CastSpellAoF(x,y,z ,sp, triggered >= 1 ? true : false);
BlueSystemMessage(m_session, "Casted aoe spell %u.", spell, GetSelectedUnitName(u));
sGMLog.writefromsession(m_session, "Casted aoe spell %u.", spell, GetSelectedUnitName(u));
return true;
}

Then the primary function we are relying on:

Code: [Select]
void Unit::CastSpellAoF(float x, float y, float z, SpellEntry* Sp, bool triggered)
{
if(Sp == NULL)
return;

SpellCastTargets targets;
targets.m_destX = x;
targets.m_destY = y;
targets.m_destZ = z;
targets.m_targetMask = TARGET_FLAG_DEST_LOCATION;
Spell* newSpell = sSpellFactoryMgr.NewSpell(this, Sp, triggered, 0);
newSpell->prepare(&targets);
}

Using this I can cast spell ID 11 onto any coordinate position basically, for example.
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #4 on: June 05, 2013, 03:08:11 pm »
:? man im new at this i only colored some npc and did a new land but im not good in server dev i see its no sql and i use a repack a mangos one so can you help me plz
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

osler

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #5 on: June 06, 2013, 09:40:30 am »
First stop using repacks. They limit ALOT your customization and bug fixing.
I recommend you moving to Trinity since mangos community is almost dead. If you want Lua coding for serverside scripts you can install Eluna (don´t go for Arcemu unless you have alot of spare time and a big dev team which can fix it)
Heare you have a Trinity compiling guide http://collab.kpsn.org/display/tc/How-to_Win
And an Eluna installation guide
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #6 on: June 06, 2013, 10:49:14 am »
i did it the compile now im comming eluna :twisted:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #7 on: June 07, 2013, 08:27:21 am »
Quote from: "osler"
First stop using repacks. They limit ALOT your customization and bug fixing.
I recommend you moving to Trinity since mangos community is almost dead. If you want Lua coding for serverside scripts you can install Eluna (don´t go for Arcemu unless you have alot of spare time and a big dev team which can fix it)
Heare you have a Trinity compiling guide http://collab.kpsn.org/display/tc/How-to_Win
And an Eluna installation guide

i did every thing compiled trinity and eluna but how to create this lua code and put it in game
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

osler

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #8 on: June 07, 2013, 11:38:54 am »
Create a folder named "scripts" where your .exe´s hve been created. Then create a .lua file there and it will be ingame. In order to make Eluna read it without restarting world server you must type ingame ".reload eluna"
For more information visit Eluna wiki: http://nomsoftware.com/wiki/doku.php?id=eluna
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #9 on: June 07, 2013, 02:33:22 pm »
Quote from: "osler"
Create a folder named "scripts" where your .exe´s hve been created. Then create a .lua file there and it will be ingame. In order to make Eluna read it without restarting world server you must type ingame ".reload eluna"
For more information visit Eluna wiki: http://nomsoftware.com/wiki/doku.php?id=eluna

ty
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #10 on: June 08, 2013, 06:40:29 pm »
Quote from: "osler"
Create a folder named "scripts" where your .exe´s hve been created. Then create a .lua file there and it will be ingame. In order to make Eluna read it without restarting world server you must type ingame ".reload eluna"
For more information visit Eluna wiki: http://nomsoftware.com/wiki/doku.php?id=eluna

man i did every thing eluna and the core but how to put this script in game plz :cry:
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

osler

  • Contributors
  • Polygonshifter
  • *****
  • Posts: 59
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #11 on: June 08, 2013, 10:31:25 pm »
Create a folder called scripts in the folder where the binaries (world and auth) and place the scripts there
« Last Edit: January 01, 1970, 01:00:00 am by Admin »

MR. Farrare

  • Registred Member
  • Creator of Worlds
  • *****
  • Posts: 963
    • View Profile
Re: [QUESTION]script for creature like scourge skydarkener
« Reply #12 on: June 09, 2013, 02:34:26 pm »
Quote from: "osler"
Create a folder called scripts in the folder where the binaries (world and auth) and place the scripts there

i have a script folder and i have dawnloaded some script from ac-web that work but  what im asking is hot work whith this stonnharry did what i copythat to a notepad and then edit it whith notpad ++ but then what how can i can make an npc like the scourge darkener in game i know the sql part but the script what i will do that is the qustion srry for my english and i hope you help (and i mean what i change in the script were i put the ids of the spell and npc that it will target it and distance) and i ment can rewrite the code of stone harry whith the spell id 11 and npc id 100000 that what the spell will target and the distance anywere plz and thx and srry for your time :|
« Last Edit: January 01, 1970, 01:00:00 am by Admin »