Hallo
ich habe mir ein Script gebaut das ich gerne in anderen Scripts wie "precast" aufrufen würde wenn das script beendet ist oder in der Char config nach jedem script laufen lasse
Das Script soll folgendes tuen;
- bereich nach corpses absuchen und die maximal mögliche anzahl skelette und Skeletmages summonen;
ich hab das Script aus der atacksequenz herraus genommen da es genau der teil ist der skelette erzeugt nun würde ich diesen gerne seperat triggern wenn ein boss besiegt wurde
ich habe mir ein Script gebaut das ich gerne in anderen Scripts wie "precast" aufrufen würde wenn das script beendet ist oder in der Char config nach jedem script laufen lasse
Das Script soll folgendes tuen;
- bereich nach corpses absuchen und die maximal mögliche anzahl skelette und Skeletmages summonen;
ich hab das Script aus der atacksequenz herraus genommen da es genau der teil ist der skelette erzeugt nun würde ich diesen gerne seperat triggern wenn ein boss besiegt wurde
Code:
// Summon skeletons until the desired number is reached
var _MWA_Attack_Slot = -1;
var _MWA_Corpse_Damage_Radius = -1.0;
var _MWA_Minion_Counts = new Array(-1, -1, -1);
function MWA_SetMinionCounts()
{
// Maximum Number of Skeletons
_MWA_Minion_Counts[0] = MWC_GetMaxMinionCount(MWS_RAISE_SKELETON);
// Define the maximum amount of Mages
_MWA_Minion_Counts[1] = MWC_GetMaxMinionCount(MWS_RAISE_SKELETAL_MAGE);
// Define the maximum amount of Revives
if(MWConfig_ReviveMinionCount <= MWC_GetMaxMinionCount(MWS_REVIVE))
_MWA_Minion_Counts[2] = MWConfig_ReviveMinionCount;
else
_MWA_Minion_Counts[2] = MWC_GetMaxMinionCount(MWS_REVIVE);
}
function MWA_RaiseMinions()
{
var _corpse, _gid, _gidsHandled, _count;
if(me.classid != NTC_CHAR_CLASS_NECROMANCER)
return false;
_gidsHandled = new Array();
MWA_SetMinionCounts();
for(var i = 0; i < 100; i++)
{
_gid = MWA_GetClosestCorpseGID(me.x, me.y, 30);
if(_gid == 0) // Stop if there are not any corpses nearby
break;
if(_gidsHandled.indexOf(_gid) > -1)
continue;
_corpse = NTC_FindUnit(NTC_UNIT_MONSTER, _gid); // Get the unit of the closest corpse
if(_corpse)
{
_gidsHandled.push(_gid);
// Summon skeletons until the desired number is reached
if(NTC_GetSkillLevel(MWS_RAISE_SKELETON) > 0 && MWConfig_SkeletonMinionCount > 0)
{
_count = MWC_GetMinionCount(MWS_RAISE_SKELETON);
if(_count < _MWA_Minion_Counts[0])
{
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Summoning " + MWC_GetMinionName(MWS_RAISE_SKELETON) + " (" + (_count + 1) + "/" + _MWA_Minion_Counts[0] + ")");
if(GetDistance(me, _corpse) > 15 || !CheckCollision(me, _corpse, 4) || !CheckCollision(me, _corpse, 2))
NTM_MoveTo(_corpse.areaid, _corpse.x, _corpse.y, 0);
NTC_CastSkill(MWS_RAISE_SKELETON, NTC_HAND_RIGHT, _corpse);
continue;
}
}
// Summon skeletal mages until the desired number is reached
if(NTC_GetSkillLevel(MWS_RAISE_SKELETAL_MAGE) > 0 && MWConfig_MageMinionCount > 0)
{
_count = MWC_GetMinionCount(MWS_RAISE_SKELETAL_MAGE);
if(_count < _MWA_Minion_Counts[1])
{
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Summoning " + MWC_GetMinionName(MWS_RAISE_SKELETAL_MAGE) + " (" + (_count + 1) + "/" + _MWA_Minion_Counts[1] + ")");
if(GetDistance(me, _corpse) > 15 || !CheckCollision(me, _corpse, 4) || !CheckCollision(me, _corpse, 2))
NTM_MoveTo(_corpse.areaid, _corpse.x, _corpse.y, 0);
NTC_CastSkill(MWS_RAISE_SKELETAL_MAGE, NTC_HAND_RIGHT, _corpse);
continue;
}
}
// Summon revives until the desired number is reached
if(NTC_GetSkillLevel(MWS_REVIVE) > 0 && MWConfig_ReviveMinionCount > 0)
{
_count = MWC_GetMinionCount(MWS_REVIVE);
if(_count < _MWA_Minion_Counts[2] && !(_corpse.spectype&0x0E))
{
if(MWConfig_ShowOverheadStatus)
MWC_PrintOverheadStatus("Reviving " + _corpse.name + " (" + (_count + 1) + "/" + _MWA_Minion_Counts[2] + ")");
if(GetDistance(me, _corpse) > 15 || !CheckCollision(me, _corpse, 4) || !CheckCollision(me, _corpse, 2))
NTM_MoveTo(_corpse.areaid, _corpse.x, _corpse.y, 0);
NTC_CastSkill(MWS_REVIVE, NTC_HAND_RIGHT, _corpse);
continue;
}
}
// Stop if the the maximum number of each minion type is reached
break;
}
}
return true;
}