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
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;}
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);}
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_WinAnd an Eluna installation guide
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
Create a folder called scripts in the folder where the binaries (world and auth) and place the scripts there