Item usage help please.

Post Reply
compmike19
Posts: 115
Joined: Wed Jan 23, 2013 11:14 pm

Item usage help please.

Post by compmike19 » Mon Feb 11, 2013 3:51 am

I've been trying to script a lot of the usable items not in there already and they seem to work with one catch I have to use an item before hand like a potion / antacid / food then they will activate. Otherwise I go to use an item the casting/using bar box pops up for a split second then does nothing. If I use one of my other items first all works fine. Here's 2 examples of the scripts; Any ideas of what the problem could be?

The Server window has no errors this is an example of what I get when trying to use an item and it won't use.
Using Kazham Earring 5x with no luck - scripted exactly like Duchy Earring
parse: 037 : 1443 1442 0A from user Compmike
parse: 037 : 144A 1449 0A from user Compmike
parse: 037 : 144F 144E 0A from user Compmike
parse: 037 : 1458 1457 0A from user Compmike
parse: 037 : 145E 145D 0A from user Compmike

Then use antacid
parse: 037 : 16A0 16F9 0A from user Compmike

Then use Kazham Earring and it works
parse: 037 : 17A9 17A8 0A from user Compmike
parse: 00D : 17BF 17BE 04 from user Compmike
CZone:: Upper_Jueno DecreaseZoneCounter <0> Compmike etc etc..

-----------------------------------------
-- ID: 16042
-- Item: Duchy Earring
-- Enchantment: "Teleport" (Upper Jueno)
-----------------------------------------

require("scripts/globals/settings");

-----------------------------------------
-- OnItemCheck
-----------------------------------------

function onItemCheck(target)
result = 0;
end;

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
target:setPos(5,0,-6,0,244);
end;


-----------------------------------------
-- ID: 10777
-- Item: Caloussu Ring
-- Item Effect: Enchantment: DEF +30
-- Durration : 5 Mins
-----------------------------------------

require("scripts/globals/settings");

-----------------------------------------
-- OnItemCheck
-----------------------------------------

function onItemCheck(target)
return 0;
end;

-----------------------------------------
-- OnItemUse
-----------------------------------------

function onItemUse(target)
if(target:hasStatusEffect(EFFECT_ENCHANTMENT) == false) then
target:addStatusEffect(EFFECT_ENCHANTMENT,0,0,300,10777);
end;
end;

-----------------------------------------
-- onEffectGain Action
-----------------------------------------

function onEffectGain(target,effect)
target:addMod(MOD_DEF, 30);
end;

-----------------------------------------
-- onEffectLose Action
-----------------------------------------

function onEffectLose(target,effect)
target:delMod(MOD_DEF, 30);
end;

User avatar
kjLotus
Special Guest
Posts: 1813
Joined: Sun Jul 22, 2012 2:16 pm

Re: Item usage help please.

Post by kjLotus » Mon Feb 11, 2013 10:41 am

require("scripts/globals/status");

compmike19
Posts: 115
Joined: Wed Jan 23, 2013 11:14 pm

Re: Item usage help please.

Post by compmike19 » Tue Feb 12, 2013 1:42 am

great thanks, that worked on the enchantment items, but still nothing on the teleport items

PrBlahBlahtson
Developer
Posts: 539
Joined: Sun Jul 22, 2012 12:17 am

Re: Item usage help please.

Post by PrBlahBlahtson » Tue Feb 12, 2013 4:12 am

Code: Select all

function onItemCheck(target)
result = 0;
end;
wat

Post Reply