I need a script to search for "Vere Umbra" in item names from items on the targeted player in their main inventory and in bag inventory.
if they have items with "Vere Umbra" in their name in their inventory destroy the items with "Vere Umbra"
Item Name Search Request
Débuté par
Ryuhi2000
, juin 22 2011 03:33
#1
Posté 22 juin 2011 - 03:33
#2
Posté 22 juin 2011 - 04:40
Since I don't know from where the script is called but you mention a targeted player, it would be:
#include "x2_inc_switches"
void main()
{
if(GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
object oPC = GetItemActivatedTarget();
if(!GetIsPC(oPC)) return;
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
if(FindSubString(GetName(oItem), "Vere Umbra") > -1) DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
Then you would give this script the same name as the activated item's tag, to use the tag-based system. Don't forget that your item must have the property Cast Spell: Unique Power on it, so that you can "use" it on your targets.
Kato
#include "x2_inc_switches"
void main()
{
if(GetUserDefinedItemEventNumber() != X2_ITEM_EVENT_ACTIVATE) return;
object oPC = GetItemActivatedTarget();
if(!GetIsPC(oPC)) return;
object oItem = GetFirstItemInInventory(oPC);
while(GetIsObjectValid(oItem))
{
if(FindSubString(GetName(oItem), "Vere Umbra") > -1) DestroyObject(oItem);
oItem = GetNextItemInInventory(oPC);
}
}
Then you would give this script the same name as the activated item's tag, to use the tag-based system. Don't forget that your item must have the property Cast Spell: Unique Power on it, so that you can "use" it on your targets.
Kato
Modifié par Kato_Yang, 22 juin 2011 - 07:24 .
#3
Posté 22 juin 2011 - 12:14
tyvm Kato i should have specified it was supposed to be a Unique Power Script but i thought it would be a given with the way i explained the target





Retour en haut






