The following warnings occurred:
Warning [2] Use of undefined constant SAPI_NAME - assumed 'SAPI_NAME' (this will throw an Error in a future version of PHP) - Line: 3388 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3388 errorHandler->error
/showthread.php 116 build_archive_link
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/inc/functions.php 3324 build_forum_breadcrumb
/showthread.php 195 build_forum_breadcrumb
Warning [2] Use of undefined constant IN_ARCHIVE - assumed 'IN_ARCHIVE' (this will throw an Error in a future version of PHP) - Line: 3331 - File: inc/functions.php PHP 7.4.33-nmm7 (Linux)
File Line Function
/inc/functions.php 3331 errorHandler->error
/showthread.php 195 build_forum_breadcrumb






Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
@UnEquip
Author Message
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #1
@UnEquip
Hello. I have function on UnEquip trigger which checking character's layers, but problem is that trigger works when item still on layer. I should check layers instantly after item was unequipped.
04-30-2013 09:19 AM
Find all posts by this user Like Post Quote this message in a reply
Mordaunt
Super Moderator
****

Posts: 1,237
Likes Given: 26
Likes Received: 55 in 43 posts
Joined: Mar 2012
Reputation: 35



Post: #2
RE: @UnEquip
It has to fire right before the unequip because return 1 will prevent the unequip

so do this instead

Code:
on=@UNEQUIP
timerf 2, f_myfunction

[Image: 2nis46r.jpg]
04-30-2013 10:56 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #3
RE: @UnEquip
Yes i understand, but i thought there maybe exist trigger which works after item was unequipped Smile
But is there another way without timerf? It have delay, and also if player will equip and unequip item many times per second (specially on macros or script), will be stack for those functions overflowed? Or some load on server?
04-30-2013 04:02 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #4
RE: @UnEquip
What are you trying to do?
04-30-2013 04:08 PM
Find all posts by this user Like Post Quote this message in a reply
Art
Journeyman
*

Posts: 118
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Apr 2012
Reputation: 0



Post: #5
RE: @UnEquip
I have tags on armors, and when player equip those armors, function recalculates extra bonus for character in dependence of tags on equipped items. Function checks items through character's layers, so, when player unequip item, at function process item still on layer, heh.
04-30-2013 07:42 PM
Find all posts by this user Like Post Quote this message in a reply
Gil Amarth
Journeyman
*

Posts: 189
Likes Given: 2
Likes Received: 1 in 1 posts
Joined: May 2012
Reputation: 0



Post: #6
RE: @UnEquip
Try:

on=@UNEQUIP
timerf 0, f_myfunction


I´m not 100% sure, but from my experience with timerf 0, the script launches just when the trigger has finished what was doing.
I also use a system of armors and clothing with this, and I haven´t problems with macros.
04-30-2013 07:54 PM
Find all posts by this user Like Post Quote this message in a reply
RanXerox
Master
**

Posts: 550
Likes Given: 1
Likes Received: 12 in 9 posts
Joined: Dec 2010
Reputation: 19



Post: #7
RE: @UnEquip
I don't see what the problem is.. I do the same thing using normal functions in @equip and @unequip ... for example:

Here are the items:

Code:
[ITEMDEF i_cap_work]
ID=i_skull_cap
NAME=work cap
DYE=1
RESOURCES=2 i_cloth,1 i_thread,i_wire_iron,i_potion_clever,i_scroll_strength
SKILLMAKE=Tailoring 30.1,t_sewing_kit,Magery 20.0
CATEGORY=Magic
SUBSECTION=Clothing
DESCRIPTION=Magic Work Cap
TAG.NotGargoyle=1
TAG.REQSTR=25
TEVENTS=e_equipitem //handle all the special tags
ON=@Create
   HITPOINTS={36 48}
   ATTR=attr_magic|attr_identified
   TAG.ResFire=3
   TAG.ResCold=5
   TAG.ResPoison=8
   TAG.ResPhysical=1
   TAG.ResEnergy=8
ON=@UnEquip
   WorkClothesUnequip
ON=@Equip
   WorkClothesEquip

And here are the functions:

Code:
[FUNCTION WorkClothesEquip]
If (<SRC.FINDLAYER(6).baseid>==i_cap_work) && (<SRC.FINDLAYER(17).Baseid>==i_apron_work) && (<SRC.FINDLAYER(7).BaseID>==i_gloves_work) && (<SRC.FINDLAYER(3).Bas
eID>==i_boots_work)
   SRC.MINING += 100
   SRC.LUMBERJACKING += 100
   SRC.MESSAGE You feel like working!
   SRC.SOUND=snd_SPELL_BLESS
   SRC.EFFECT=3,i_fx_bless_effect,6,16,0
Else
   SRC.MINING += 20
   SRC.LUMBERJACKING += 20
EndIf

[FUNCTION WorkClothesUnequip]
If (<SRC.FINDLAYER(6).baseid>==i_cap_work) && (<SRC.FINDLAYER(17).Baseid>==i_apron_work) && (<SRC.FINDLAYER(7).BaseID>==i_gloves_work) && (<SRC.FINDLAYER(3).Bas
eID>==i_boots_work)
   SRC.MINING -= 100
   SRC.LUMBERJACKING -= 100
   SRC.MESSAGE You feel like resting...
   SRC.SOUND=snd_SPELL_BLESS
   SRC.EFFECT=3,i_fx_bless_effect,6,16,0
Else
   SRC.MINING -= 20
   SRC.LUMBERJACKING -= 20
EndIf
05-01-2013 01:25 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)