Ahoi!
Ich wollt mich eben davor drücken den Konjunktiv im Perfektstamm der a,e und konsonantischer Konjugation in Latein zu lernen und dacht mir ich teil mal meine lustige Idee :)
Freunde whispen, wenn Item gefunden wurde. Es sei vielleicht angemerkt, dass ich nich diese Botversion benutze (sonder die Muddies-Extended) und deswegen die Functions bisschen anders heißen, es soll ja auch nur ne Idee sein :
NTSnagit.ntl (Aus Muddies-Extended) modifiziert.:
Code:
var _NTSI_IgnoredList = new Array(
526, // Arrows quiver
528, // Bolts quiver
543, // Keys
518, // Tome of Town Portal
519, // Tome of Identify
529, // Scroll of Town Portal
530, // Scroll of Identify
514, // Antidote potion
513, // Stamina potion
517, // Thawing potion
80, // Rancid Gas Pot
81, // Oil Potion
82, // Choking Gas Pot
83, // Exploding Pot
84, // Strangling Gas
85); // Fulminating Pot
var _NTSI_BeltSize;
var lastItemQuality;
var lastItemName;
var lastItemItemLevel;
var lastItemDesc;
function NTSI_LoadNIPFiles(filepath)
{
for(var i = 0 ; i < NTConfig_NIPFilePath.length ; i++)
NTIPOpenFile(filepath + "/" + NTConfig_NIPFilePath[i]);
_NTSI_BeltSize = NTC_GetBeltSize();
}
function NTSI_PickItems()
{
var i, _mode;
for(i = 0 ; i < 25 ; i++)
{
_mode = me.mode;
if((_mode >= 1 && _mode <= 3) || _mode == 5 || _mode == 6)
break;
NTC_Delay(NTC_DELAY_FRAME);
}
if(i < parseInt(NTConfig_SnagDelay/NTC_DELAY_FRAME))
NTC_PingDelay(NTConfig_SnagDelay-(i*NTC_DELAY_FRAME));
Include("libs/common/NTItemlogger.ntl");
NTI_WriteLoc();
NTSI_SnagIt();
}
function NTSI_SnagIt()
{
var i;
var _item;
var _checkeditem, _checkeditems;
var _value;
var _minindex, _mindistance;
_item = NTC_FindUnit(NTC_UNIT_ITEM);
if(!_item)
return;
_checkeditems = new Array();
do
{
if(_item.mode == 3 || _item.mode == 5)
{
if(NTSI_IsIgnoredItemInt(_item.classid))
continue;
if(GetDistance(me, _item) <= NTConfig_SnagRange)
{
_value = NTSI_CheckItem(_item);
if(_value)
_checkeditems.push(new NTSI_ItemInt(_item, _value));
}
}
} while(_item.GetNext());
while(_checkeditems.length > 0)
{
_mindistance = 100000;
for(i = 0 ; i < _checkeditems.length ; i++)
{
_value = GetDistance(me.x, me.y, _checkeditems[i].x, _checkeditems[i].y);
if(_value < _mindistance)
{
_minindex = i;
_mindistance = _value;
}
}
_checkeditem = _checkeditems.splice(_minindex, 1)[0];
_item = NTC_FindUnit(NTC_UNIT_ITEM, _checkeditem.GID);
if(_item)
{
if(!NTSI_IsLimitedItemInt(_item))
{
if(NTT_CheckSpace(_item.xsize, _item.ysize))
{
if(NTSI_PickUpItemInt(_item) && _item)
{
var _outputColor = "";
var _outputColorMGR = "";
if((_item.classid >= 644 && _item.classid <= 658) || (_item.classid >= 531 && _item.classid <= 555) || (_item.classid >= 610 && _item.classid <= 642))
{
_outputColor = NTC_ItemQualityToD2Color[8];
_outputColorMGR = NTC_ItemQualityToMGRColor[8];
}
else
{
_outputColor = NTC_ItemQualityToD2Color[_item.quality];
_outputColorMGR = NTC_ItemQualityToMGRColor[_item.quality];
}
if(_item && (_item.itemtype < 76 || _item.itemtype > 81) && _checkeditem.ClassID != 523 )
Print("Picked up " + _outputColor + _item.name.split("\n")[0]);
if(NTConfig_ShowGoldPickups && _checkeditem.ClassID == 523)
Print("Picked up Gold");
if(_item && NTConfig_ShowPotionPickups && _item.itemtype >= 76 && _item.itemtype <= 78)
Print("Picked " + _item.name.split("\n")[0]);
if(_item.quality < 4 && _checkeditem.Status < 2 && _item.itemtype != 4 && (_item.itemtype < 76 || _item.itemtype > 81))
{
var _isEthereal = ((_item.itemflag & 0x400000) == 0x400000) ? 1 : 0;
if(NTConfig_UseXMLItemlog)
{
if(NTI_WriteLog(_item, me, _isEthereal, 0))
{
NTC_SendLogToOOG(NTC_LOG_ITEM, "Kept " + _outputColorMGR + _item.name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _item.itemdesc + "\nÿc5Item Level: " + _item.itemlevel);
Say("/f m Just found " + _item.name + " at " + NTI_ReadLoc() + "!");
}
}
else
{
NTC_SendLogToOOG(NTC_LOG_ITEM, "Kept " + _outputColorMGR + _item.name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _item.itemdesc + "\nÿc5Item Level: " + _item.itemlevel);
[COLOR="Red"] Say("/f m Just found " + _item.name + " at " + NTI_ReadLoc() + "!");[/COLOR]
}
}
}
}
else
{
if(!_checkeditem.Retry)
{
_checkeditem.Retry = true;
if(!NTTMGR_VisitTown())
return;
_checkeditems.push(_checkeditem);
}
}
}
}
}
}
function NTSI_CheckItem(item)
{
var _result;
switch(item.quality)
{
case 5:
case 8:
_result = NTIPCheckItem(item);
break;
default:
_result = NTIPCheckItem(item);
if(NTCU_CheckItem(item, _result))
_result = 2;
break;
}
return _result;
}
// Internal function
function NTSI_ItemInt(item, checkedstatus)
{
this.ClassID = item.classid;
this.GID = item.gid;
this.x = item.x;
this.y = item.y;
this.Status = checkedstatus;
this.Retry = false;
}
function NTSI_PickUpItemInt(snagitem)
{
var i;
var _classid;
_classid = snagitem.classid;
for(i = 0 ; i < 40 ; i++)
{
if((i % 10) == 0 && (snagitem.mode == 3 || snagitem.mode == 5))
{
if(GetDistance(me, snagitem) > 3)
NTM_MoveTo(snagitem.areaid, snagitem.x, snagitem.y);
if(NTC_ClearCursor())
NTC_DoClick(NTC_CLICK_LDOWN, NTC_SHIFT_NONE, snagitem);
}
NTC_Delay(NTC_DELAY_FRAME);
if(_classid == 523 || (snagitem.mode != 3 && snagitem.mode != 5))
{
NTC_PingDelay(100);
return true;
}
}
return false;
}
function NTSI_IsIgnoredItemInt(classid)
{
for(var i = 0 ; i < _NTSI_IgnoredList.length ; i++)
{
if(classid == _NTSI_IgnoredList[i])
return true;
}
return false;
}
function NTSI_IsLimitedItemInt(item)
{
var i;
var _items;
if(item.itemtype >= 76 && item.itemtype <= 78)
{
var _code, _type;
var _potnum = 0;
_code = item.code;
_type = item.itemtype;
for(i = 0 ; i < 4 ; i++)
{
if(_code.indexOf(NTConfig_BeltColType[i]) != -1)
_potnum += _NTSI_BeltSize;
}
_items = me.GetItems();
if(_items)
{
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].mode == 2 && _items[i].itemtype == _type)
_potnum--;
}
if(_potnum < 1)
return true;
}
}
else if(item.quality == 7 && item.classid >= 603 && item.classid <= 605)
{
_items = me.GetItems(item.classid);
if(_items)
{
for(i = 0 ; i < _items.length ; i++)
{
if(_items[i].quality == 7)
return true;
}
}
}
return false;
}
NTTownManager.ntl (ebenfalls aus Muddies-Extended), modifiziert.:
Code:
var _NTTMGR_BuyPots;
var _NTTMGR_BuyTP;
var _NTTMGR_BuyKey;
var _NTTMGR_DoHeal;
var _NTTMGR_DoID;
var _NTTMGR_DoRepair;
var _NTTMGR_DoRevive;
var _NTTMGR_RemoveCurse;
function NTTMGR_TownManager(simple)
{
var _cubing;
if(arguments.length < 1)
simple = false;
NTC_ClearCursor();
NTT_CleanPotions();
_NTTMGR_BuyPots = NTT_CheckBelt();
_NTTMGR_BuyTP = (NTTMGR_CheckScrolls(1) < 4);
_NTTMGR_BuyKey = (NTConfig_OpenChest && NTTMGR_CheckKeys() < 4);
_NTTMGR_DoHeal = NTT_CheckHeal();
_NTTMGR_DoID = NTT_CheckUnids();
_NTTMGR_DoRepair = NTT_CheckRepair(40);
_NTTMGR_DoRevive = NTT_CheckMerc();
_NTTMGR_RemoveCurse = NTTMGR_CheckCurse(NTConfig_CheckSelfSafe > 0x01 ? 0x7E : 0, NTConfig_CheckMercSafe > 0x01 ? 0x7E : 0);
NTCU_InitCubing();
NTC_PutSkill(115, NTC_HAND_RIGHT);
switch(me.act)
{
case 1:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID)
NTTMGR_VisitAkara();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
if(_NTTMGR_DoRevive)
NTTMGR_VisitKashya();
if(_NTTMGR_DoRepair)
NTTMGR_VisitCharsi();
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
NTTMGR_VisitGheed();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
}
break;
case 2:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_DoRepair)
NTTMGR_VisitFara();
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
NTTMGR_VisitDrognan();
if(_NTTMGR_BuyKey)
NTTMGR_VisitLysander();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
if(_NTTMGR_DoRevive)
NTTMGR_VisitGreiz();
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
NTTMGR_VisitElzix();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
}
break;
case 3:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
NTTMGR_VisitOrmus();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
if(_NTTMGR_DoRevive)
NTTMGR_VisitAsheara();
if(_NTTMGR_DoRepair || _NTTMGR_BuyKey)
NTTMGR_VisitHratli();
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
NTTMGR_VisitAlkor();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
}
break;
case 4:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID)
NTTMGR_VisitJamella(false);
if(_NTTMGR_DoRepair)
NTTMGR_VisitHalbu();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
if(_NTTMGR_DoRevive)
NTTMGR_VisitTyrael();
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
NTTMGR_VisitJamella(true);
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
}
break;
case 5:
if(_NTTMGR_DoHeal || _NTTMGR_RemoveCurse || _NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID)
NTTMGR_VisitMalah();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
if(_NTTMGR_DoRepair)
NTTMGR_VisitLarzuk();
if(_NTTMGR_DoRevive)
NTTMGR_VisitQualKehk();
if(!simple && NTConfig_Gamble && NTC_MyGold() > NTConfig_GambleStartGold)
{
NTTMGR_VisitAnya();
_cubing = (!simple && NTCU_CheckCubing());
if(_cubing || NTT_CheckInventory())
NTTMGR_VisitStash(_cubing);
}
break;
}
}
function NTTMGR_VisitTown()
{
var _prearea = me.areaid;
if(!NTTM_CheckAct())
return false;
NTTMGR_TownManager(true);
if(!NTTM_TownMove("portalspot"))
return false;
if(!NTM_UsePortal("BluePortal", _prearea))
return false;
if(NTConfig_PublicMode)
NTM_MakeTP();
return true;
}
function NTTMGR_VisitStash(cubing)
{
var _stash;
NTTM_TownMove("stash");
_stash = NTC_FindUnit(NTC_UNIT_OBJECT, NTC_UNIT_STASH, 5);
if(_stash)
{
if(NTT_DoInteract(_stash))
{
NTT_ManageStash();
if(cubing)
{
NTCU_DoCubing();
if(NTT_DoInteract(_stash))
NTT_ManageStash();
me.Cancel(1);
NTT_ClearInventory();
}
else
me.Cancel(1);
}
}
}
function NTTMGR_VisitAkara()
{
var _npc;
NTTM_TownMove("akara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_AKARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_BuyPots)
NTT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitKashya()
{
var _npc;
NTTM_TownMove("kashya");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_KASHYA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
if(NTConfig_ResetWeapon)
NTT_ResetWeaponMerc();
}
}
}
function NTTMGR_VisitCharsi()
{
var _npc;
NTTM_TownMove("charsi");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_CHARSI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
NTT_RepairItems(_npc);
me.Cancel(1);
}
}
}
function NTTMGR_VisitGheed()
{
var _npc;
NTTM_TownMove("gheed");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GHEED, 5);
if(_npc)
{
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc, 1))
NTT_GambleIt(_npc);
me.Cancel(1);
}
else
break;
}
}
}
function NTTMGR_VisitFara()
{
var _npc;
NTTM_TownMove("fara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_FARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_DoRepair)
{
if(NTT_DoTrade(_npc))
NTT_RepairItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitDrognan()
{
var _npc;
NTTM_TownMove("drognan");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_DROGNAN, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_BuyPots)
NTT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitLysander()
{
var _npc;
NTTM_TownMove("lysander");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LYSANDER, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
NTT_FillKey(_npc);
me.Cancel(1);
}
}
}
function NTTMGR_VisitGreiz()
{
var _npc;
NTTM_TownMove("greiz");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_GREIZ, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
if(NTConfig_ResetWeapon)
NTT_ResetWeaponMerc();
}
}
}
function NTTMGR_VisitElzix()
{
var _npc;
NTTM_TownMove("elzix");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ELZIX, 5);
if(_npc)
{
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc, 1))
NTT_GambleIt(_npc);
me.Cancel(1);
}
else
break;
}
}
}
function NTTMGR_VisitOrmus()
{
var _npc;
NTTM_TownMove("ormus");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ORMUS, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_DoID)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_BuyPots)
NTT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitAsheara()
{
var _npc;
NTTM_TownMove("asheara");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ASHEARA, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
if(NTConfig_ResetWeapon)
NTT_ResetWeaponMerc();
}
}
}
function NTTMGR_VisitHratli()
{
var _npc;
NTTM_TownMove("hratli");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HRATLI, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_DoRepair)
NTT_RepairItems(_npc);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitAlkor()
{
var _npc;
NTTM_TownMove("alkor");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ALKOR, 5);
if(_npc)
{
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc, 1))
NTT_GambleIt(_npc);
me.Cancel(1);
}
else
break;
}
}
}
function NTTMGR_VisitJamella(gamble)
{
var _npc;
NTTM_TownMove("jamella");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_JAMELLA, 5);
if(_npc)
{
if(gamble)
{
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc, 1))
NTT_GambleIt(_npc);
me.Cancel(1);
}
else
break;
}
}
else
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_BuyPots)
NTT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
}
}
me.Cancel(1);
}
}
}
}
function NTTMGR_VisitHalbu()
{
var _npc;
NTTM_TownMove("halbu");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_HALBU, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
NTT_RepairItems(_npc);
me.Cancel(1);
}
}
}
function NTTMGR_VisitTyrael()
{
var _npc;
NTTM_TownMove("tyrael");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_TYRAEL_ACT_4, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
if(NTConfig_ResetWeapon)
NTT_ResetWeaponMerc();
}
}
}
function NTTMGR_VisitMalah()
{
var _npc;
NTTM_TownMove("malah");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_MALAH, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(_NTTMGR_BuyPots || _NTTMGR_BuyTP || _NTTMGR_BuyKey || _NTTMGR_DoID)
{
if(NTT_DoTrade(_npc))
{
if(_NTTMGR_BuyPots)
NTT_FillBelt(_npc);
if(_NTTMGR_BuyTP)
NTT_FillTome(_npc, 1);
if(_NTTMGR_BuyKey)
NTT_FillKey(_npc);
if(_NTTMGR_DoID)
NTTMGR_IDItems(_npc);
}
}
me.Cancel(1);
}
}
}
function NTTMGR_VisitLarzuk()
{
var _npc;
NTTM_TownMove("larzuk");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_LARZUK, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc))
NTT_RepairItems(_npc);
me.Cancel(1);
}
}
}
function NTTMGR_VisitQualKehk()
{
var _npc;
NTTM_TownMove("qual-kehk");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_QUALKEHK, 5);
if(_npc)
{
if(NTT_DoInteract(_npc))
{
NTT_ReviveMerc();
me.Cancel(1);
if(NTConfig_ResetWeapon)
NTT_ResetWeaponMerc();
}
}
}
function NTTMGR_VisitAnya()
{
var _npc;
NTTM_TownMove("anya");
_npc = NTC_FindUnit(NTC_UNIT_NPC, NTC_NPC_ID_ANYA_TOWN, 5);
if(_npc)
{
while(NTC_MyGold() > NTConfig_GambleStopGold)
{
if(NTT_DoInteract(_npc))
{
if(NTT_DoTrade(_npc, 1))
NTT_GambleIt(_npc);
me.Cancel(1);
}
else
break;
}
}
}
function NTTMGR_CheckScrolls(scrolltype)
{
var _tome = NTT_GetTome(scrolltype);
if(_tome)
return _tome.GetStat(70);
return 0;
}
function NTTMGR_CheckKeys()
{
var _key;
if(me.classid == NTC_CHAR_CLASS_ASSASSIN)
return 12;
_key = NTT_GetKey();
if(_key)
return _key.GetStat(70);
return 0;
}
function NTTMGR_IDItems(npc)
{
Include("libs/common/NTItemlogger.ntl");
var _tome, _scroll;
var _result;
var _items = NTT_GetUnidItems();
if(!_items || _items.length < 1)
return;
_tome = NTT_GetTome();
if(_tome && _tome.GetStat(70) < _items.length)
NTT_FillTome(npc);
for(var i = 0 ; i < _items.length ; i++)
{
var _isEthereal = ((_items[i].itemflag & 0x400000) == 0x400000) ? 1 : 0;
switch(NTSI_CheckItem(_items[i]))
{
case 1:
if(NTConfig_UseXMLItemlog)
{
if(NTI_WriteLog(_items[i], me, _isEthereal, 0))
{
NTC_SendLogToOOG(NTC_LOG_ITEM, "Kept " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _items[i].itemdesc + "\nÿc5Item Level: " + _items[i].itemlevel);
[COLOR="Red"]Say("/f m Just found " + _items[i].name + " at " + NTI_ReadLoc() + "!");[/COLOR]
}
}
else
{
NTC_SendLogToOOG(NTC_LOG_ITEM, "Kept " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _items[i].itemdesc + "\nÿc5Item Level: " + _items[i].itemlevel);
[COLOR="Red"]Say("/f m Just found " + _items[i].name + " at " + NTI_ReadLoc() + "!");[/COLOR]
}
case 2:
break;
case -1:
if(_tome)
_result = NTT_IdItem(_tome, _items[i]);
else
{
_scroll = NTT_GetScroll();
if(!_scroll)
{
NTT_BuyScrolls(npc);
_scroll = NTT_GetScroll();
}
_result = NTT_IdItem(_scroll, _items[i]);
}
if(_result)
{
switch(NTSI_CheckItem(_items[i]))
{
case 1:
if(NTConfig_UseXMLItemlog)
{
if(NTI_WriteLog(_items[i], me, _isEthereal, 0))
{
NTC_SendLogToOOG(NTC_LOG_ITEM, "Kept " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _items[i].itemdesc + "\nÿc5Item Level: " + _items[i].itemlevel);
[COLOR="Red"]Say("/f m Just found " + _items[i].name + " at " + NTI_ReadLoc() + "!");[/COLOR]
}
}
else
{
NTC_SendLogToOOG(NTC_LOG_ITEM, "Kept " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _items[i].itemdesc + "\nÿc5Item Level: " + _items[i].itemlevel);
[COLOR="Red"] Say("/f m Just found " + _items[i].name + " at " + NTI_ReadLoc() + "!");[/COLOR]
}
case 2:
break;
default:
if(NTConfig_UseXMLItemlog)
NTI_WriteLog(_items[i], me, _isEthereal, 1);
if(NTConfig_LogSoldItems)
NTC_SendLogToOOG(NTC_LOG_ITEM, "Sold " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _items[i].itemdesc + "\nÿc5Item Level: " + _items[i].itemlevel);
NTT_ShopItem(_items[i], npc, 1);
break;
}
}
else
{
if(NTConfig_UseXMLItemlog)
NTI_WriteLog(_items[i], me, _isEthereal, 1);
if(NTConfig_LogSoldItems)
NTC_SendLogToOOG(NTC_LOG_ITEM, "Sold " + NTC_ItemQualityToMGRColor[_items[i].quality] + _items[i].name.split("\n")[0] + " ÿc6(" + NTI_ReadLoc() + ")" + ";" + _items[i].itemdesc + "\nÿc5Item Level: " + _items[i].itemlevel);
NTT_ShopItem(_items[i], npc, 1);
}
break;
}
}
}
// mask - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
function NTTMGR_CheckCurse(selfmask, mercmask)
{
if(selfmask > 0x01)
{
if((selfmask&0x02) && me.GetState(2))
return true;
if((selfmask&0x04) && me.GetState(9))
return true;
if((selfmask&0x08) && me.GetState(19))
return true;
if((selfmask&0x10) && me.GetState(55))
return true;
if((selfmask&0x20) && me.GetState(60))
return true;
if((selfmask&0x40) && me.GetState(61))
return true;
}
if(mercmask > 0x01)
{
var _merc = NTC_GetMerc();
if(_merc)
{
if((mercmask&0x02) && _merc.GetState(2))
return true;
if((mercmask&0x04) && _merc.GetState(9))
return true;
if((mercmask&0x08) && _merc.GetState(19))
return true;
if((mercmask&0x10) && _merc.GetState(55))
return true;
if((mercmask&0x20) && _merc.GetState(60))
return true;
if((mercmask&0x40) && _merc.GetState(61))
return true;
}
}
return false;
}
// self - 0x01 : Potion
// merc - 0x01 : Death
// common - 0x02 : Poison, 0x04 : Amplify Damage, 0x08 : Weaken, 0x10 : Iron Maiden, 0x20 : Decrepify, 0x40 : Lower Resist
function NTTMGR_CheckSafe(selfmask, mercmask)
{
if(((selfmask&0x01) && NTT_CheckBelt()) || ((mercmask&0x01) && NTT_CheckMerc()) || NTTMGR_CheckCurse(selfmask, mercmask))
return NTTMGR_VisitTown();
return true;
}
Zeilen wurden rot hervorgehoben.
Ich find´s immerwieder lustig, wenn meine f-list sowas wie : "Just found Ist Rune at Tower Cellar Level 5" und 9 mins später "Just found Lo Rune at Durance of Hate Level 3" liest :)
Ich würd mir sowas mit ner Variablen in der Charconfig vorstellen können.
Nojo, nur so ´ne Idee, falls du zu wenig Prüfungen schreiben solltest ;)
Btw., go Muddy, go Muddy!
Don Greetings,
Zerker.jar
Edit: Das ist der "Juhu, hab´ auch ´ne Idee, wenn auch nicht so Burner" - Blues.... :P