254 lines
8.3 KiB
Plaintext
254 lines
8.3 KiB
Plaintext
#include "moditem2"
|
|
object oItem;
|
|
object oTarget;
|
|
/* Script generated by
|
|
Lilac Soul's NWN Script Generator, v. 1.6
|
|
|
|
For download info, please visit:
|
|
http://www.lilacsoul.revility.com */
|
|
|
|
//Put this OnUsed
|
|
void main()
|
|
{
|
|
object oPC = GetLastUsedBy();
|
|
object oTarget = OBJECT_SELF;
|
|
int oCount=0;
|
|
int oPearl=0;
|
|
int oPcount=0;
|
|
int oCoin=0;
|
|
int oCloak = 0;
|
|
int oNcount= 0;
|
|
int oAmmo;
|
|
int oDaxe = BASE_ITEM_DWARVENWARAXE;
|
|
int oRapier = BASE_ITEM_RAPIER;
|
|
int oLongsword = BASE_ITEM_LONGSWORD;
|
|
int oBastardsword = BASE_ITEM_BASTARDSWORD;
|
|
int oBattleaxe = BASE_ITEM_BATTLEAXE;
|
|
int oKukri = BASE_ITEM_KUKRI;
|
|
int oWarhammer = BASE_ITEM_WARHAMMER;
|
|
int oShortsword = BASE_ITEM_SHORTSWORD;
|
|
int oKama = BASE_ITEM_KAMA;
|
|
int oGreatsword = BASE_ITEM_GREATSWORD;
|
|
int oLbow = BASE_ITEM_LONGBOW;
|
|
int oHcrossbow = BASE_ITEM_HEAVYCROSSBOW;
|
|
int oSbow = BASE_ITEM_SHORTBOW;
|
|
int oLcrossbow = BASE_ITEM_LIGHTCROSSBOW;
|
|
int oDbaxe = BASE_ITEM_DOUBLEAXE;
|
|
int oDsword = BASE_ITEM_TWOBLADEDSWORD;
|
|
int oWhip = BASE_ITEM_WHIP;
|
|
int oSickle = BASE_ITEM_SICKLE;
|
|
int oScythe = BASE_ITEM_SCYTHE;
|
|
int oMstar = BASE_ITEM_MORNINGSTAR;
|
|
int oQstaff = BASE_ITEM_QUARTERSTAFF;
|
|
int oScim = BASE_ITEM_SCIMITAR;
|
|
int oSpear = BASE_ITEM_SHORTSPEAR;
|
|
int oLflail = BASE_ITEM_LIGHTFLAIL;
|
|
int oHflail = BASE_ITEM_HEAVYFLAIL;
|
|
int oHberd = BASE_ITEM_HALBERD;
|
|
int oGaxe = BASE_ITEM_GREATAXE;
|
|
int oKatana = BASE_ITEM_KATANA;
|
|
int oLmace = BASE_ITEM_LIGHTMACE;
|
|
int oDmace = BASE_ITEM_DIREMACE;
|
|
int oDagg = BASE_ITEM_DAGGER;
|
|
int oBolt = BASE_ITEM_BOLT;
|
|
int oArrow = BASE_ITEM_ARROW;
|
|
|
|
|
|
object oItem = GetFirstItemInInventory(OBJECT_SELF);
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
++oCount;
|
|
oItem = GetNextItemInInventory(OBJECT_SELF);
|
|
}
|
|
|
|
if (oCount==1)
|
|
{
|
|
oItem = GetFirstItemInInventory(OBJECT_SELF);
|
|
if ((GetTag(oItem)=="pearl")||(GetTag(oItem)=="coin1")||(GetTag(oItem)=="coin2"))
|
|
{
|
|
FloatingTextStringOnCreature("You need an item as well.", oPC);
|
|
PlaySound("sim_cntresist");
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
FloatingTextStringOnCreature("You need an Arena Token to invoke Amaterasu's power", oPC);
|
|
PlaySound("sim_cntresist");
|
|
return;
|
|
}
|
|
}
|
|
if (oCount==0)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if ((oCount>1)&&(oCount<3))
|
|
{
|
|
oItem = GetFirstItemInInventory(OBJECT_SELF);
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if ((GetTag(oItem)=="pearl")||(GetTag(oItem)=="coin1")||
|
|
(GetTag(oItem)=="coin2"))
|
|
{
|
|
oPearl = 1;
|
|
++oPcount;
|
|
}
|
|
else
|
|
{
|
|
++oNcount;
|
|
}
|
|
oItem = GetNextItemInInventory(OBJECT_SELF);
|
|
}
|
|
|
|
if (oNcount==2)
|
|
{
|
|
FloatingTextStringOnCreature("You need an arena token and one item to invoke Amaterasu's power", oPC);
|
|
PlaySound("sim_cntresist");
|
|
return;
|
|
}
|
|
if (oPcount>1)
|
|
{
|
|
FloatingTextStringOnCreature("You can not use more than one Arena Token", oPC);
|
|
PlaySound("sim_cntresist");
|
|
return;
|
|
}
|
|
if (oPearl==1)
|
|
{
|
|
oItem = GetFirstItemInInventory(OBJECT_SELF);
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetTag(oItem)=="pearl")
|
|
{
|
|
oCoin=1;
|
|
}
|
|
if (GetTag(oItem)=="coin1")
|
|
{
|
|
oCoin=2;
|
|
}
|
|
if (GetTag(oItem)=="coin2")
|
|
{
|
|
oCoin=3;
|
|
}
|
|
oItem = GetNextItemInInventory(OBJECT_SELF);
|
|
}
|
|
oItem=GetFirstItemInInventory(OBJECT_SELF);
|
|
if (oCoin==1)
|
|
{
|
|
AssignCommand(oPC, PlaySound("as_mg_telepin1"));
|
|
AssignCommand(oPC, PlaySound("sce_positive"));
|
|
DelayCommand(0.5, ModNow(oItem, oPC));
|
|
return;
|
|
}
|
|
else if (oCoin==3)
|
|
{
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if ((GetBaseItemType(oItem)==oRapier)||
|
|
(GetBaseItemType(oItem)==oShortsword)||
|
|
(GetBaseItemType(oItem)==oLongsword)||
|
|
(GetBaseItemType(oItem)==oBastardsword)||
|
|
(GetBaseItemType(oItem)==oBattleaxe)||
|
|
(GetBaseItemType(oItem)==oKukri)||
|
|
(GetBaseItemType(oItem)==oWarhammer)||
|
|
(GetBaseItemType(oItem)==oKama)||
|
|
(GetBaseItemType(oItem)==oGreatsword)||
|
|
(GetBaseItemType(oItem)==oDaxe)||
|
|
(GetBaseItemType(oItem)==oDbaxe)||
|
|
(GetBaseItemType(oItem)==oDsword)||
|
|
(GetBaseItemType(oItem)==oWhip)||
|
|
(GetBaseItemType(oItem)==oSickle)||
|
|
(GetBaseItemType(oItem)==oScythe)||
|
|
(GetBaseItemType(oItem)==oMstar)||
|
|
(GetBaseItemType(oItem)==oQstaff)||
|
|
(GetBaseItemType(oItem)==oScim)||
|
|
(GetBaseItemType(oItem)==oSpear)||
|
|
(GetBaseItemType(oItem)==oLflail)||
|
|
(GetBaseItemType(oItem)==oHflail)||
|
|
(GetBaseItemType(oItem)==oHberd)||
|
|
(GetBaseItemType(oItem)==oGaxe)||
|
|
(GetBaseItemType(oItem)==oScim)||
|
|
(GetBaseItemType(oItem)==oKatana)||
|
|
(GetBaseItemType(oItem)==oLmace)||
|
|
(GetBaseItemType(oItem)==oDmace)||
|
|
(GetBaseItemType(oItem)==oDagg)||
|
|
(GetBaseItemType(oItem)==oBolt)||
|
|
(GetBaseItemType(oItem)==oArrow))
|
|
{
|
|
oCloak = 3;
|
|
if ((GetBaseItemType(oItem)==oBolt)||
|
|
(GetBaseItemType(oItem)==oArrow))
|
|
{
|
|
oAmmo=1;
|
|
}
|
|
}
|
|
oItem = GetNextItemInInventory(OBJECT_SELF);
|
|
}
|
|
if (oCloak==3)
|
|
{
|
|
if (oAmmo==1)
|
|
{
|
|
AssignCommand(oPC, PlaySound("as_mg_telepin1"));
|
|
AssignCommand(oPC, PlaySound("sce_positive"));
|
|
DelayCommand(0.5, ActionStartConversation(oPC, "weap_enh2", TRUE, FALSE));
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
AssignCommand(oPC, PlaySound("as_mg_telepin1"));
|
|
AssignCommand(oPC, PlaySound("sce_positive"));
|
|
DelayCommand(0.5, ActionStartConversation(oPC, "weap_enh", TRUE, FALSE));
|
|
return;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
PlaySound("sim_cntresist");
|
|
FloatingTextStringOnCreature
|
|
("You can't use a Silver arena token on this item", oPC);
|
|
}
|
|
}
|
|
else
|
|
{
|
|
while (GetIsObjectValid(oItem))
|
|
{
|
|
if (GetBaseItemType(oItem)== BASE_ITEM_TOWERSHIELD)
|
|
{
|
|
oCloak = 1;
|
|
}
|
|
if (GetBaseItemType(oItem)== BASE_ITEM_AMULET)
|
|
{
|
|
oCloak = 2;
|
|
}
|
|
oItem = GetNextItemInInventory(OBJECT_SELF);
|
|
}
|
|
if (oCloak==1)
|
|
{
|
|
AssignCommand(oPC, PlaySound("as_mg_telepin1"));
|
|
AssignCommand(oPC, PlaySound("sce_positive"));
|
|
DelayCommand(0.5, ActionStartConversation(oPC, "damage_red", TRUE, FALSE));
|
|
return;
|
|
}
|
|
else if (oCloak==2)
|
|
{
|
|
AssignCommand(oPC, PlaySound("as_mg_telepin1"));
|
|
AssignCommand(oPC, PlaySound("sce_positive"));
|
|
DelayCommand(0.5, ActionStartConversation(oPC, "amulet_red", TRUE, FALSE));
|
|
return;
|
|
}
|
|
else
|
|
{
|
|
PlaySound("sim_cntresist");
|
|
FloatingTextStringOnCreature
|
|
("You can't use a gold arena token on this item", oPC);
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else
|
|
{
|
|
FloatingTextStringOnCreature("Too many items!", oPC);
|
|
PlaySound("sim_cntresist");
|
|
}
|
|
}
|
|
|