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-nmm6 (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-nmm6 (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-nmm6 (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 gloves, arms, and help when use archery.
Author Message
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #1
Unequip gloves, arms, and help when use archery.
Anyone can create me something like this?

When you equip a bow or crossbow, unequips instantly the gloves, arms and any helm [PLATEMAIL]

And, when I equip a helm or arms or gloves PLATEMAIL TYPE, checks the bow and unequip it.

If I need add a TEVENTS= in EVERY armor, no problem ^_^ I'll do it.


Thanks!

Sry for the english.
I wish that you can understand me Tongue

[Image: 2hy9q0y.png]
08-27-2012 06:03 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Shaklaban
Master
**

Posts: 378
Likes Given: 0
Likes Received: 1 in 1 posts
Joined: Mar 2012
Reputation: 8

DOT

Post: #2
RE: Unequip gloves, arms, and help when use archery.
PHP Code:
[typedef t_weapon_bow]
on=@equip
src
.unequip_helm_gloves

[typedef t_weapon_xbow]
on=@equip
src
.unequip_helm_gloves


[function unequip_helm_gloves]
for 
6 7
if (<findlayer.<local._for>>)
   if (<
findlayer.<local._for>.isavaiblewitharchery> = 0)
        
findlayer.<local._for>.cont=<findlayer.layer_pack>
   endif
endif
endfor
  

[
typedef t_armor]
on=@equiptest
if ((<findlayer.layer_hand2.type> = t_weapon_bow) || (<findlayer.layer_hand2.type> = t_weapon_xbow))
    if (<
isavaiblewitharchery> = 0)
        return 
1
    
endif
endif
 

[function 
isavaiblewitharchery]
if <
type> != t_armor
    
return 1
else
     
local.dispidsi=<serv.itemdef.<baseid>.dispid//aganist flipping
     
if (<serv.itemdef.<local.dispidsi>.tag0.noarchery> = 1//with that line you don't need to add tag.noarchery to gold, blackrock etc. items
         
return 0
    
endif
endif
return 
1


//example item def.

[ITEMDEF 01412]
DEFNAME=i_platemail_helm
TYPE
=T_ARMOR
FLIP
=1
RESOURCES
=15 i_ingot_iron
WEIGHT
=10
ARMOR
=40
REQSTR
=60
CATEGORY
=Provisions Armor
SUBSECTION
=Platemail Armor
DESCRIPTION
=Platemail Helm
DUPELIST
=01419
SKILLMAKE
=BLACKSMITHING 62.6
TAG
.NOARCHERY=//NO ARCHERY

ON=@Create
COLOR
=color_o_iron
HITPOINTS
={50 60
(This post was last modified: 08-28-2012 02:38 AM by Shaklaban.)
08-27-2012 08:44 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Extreme
Grandmaster Poster
***

Posts: 1,141
Likes Given: 217
Likes Received: 90 in 77 posts
Joined: May 2012
Reputation: 20

SphereCommunity

Post: #3
RE: Unequip gloves, arms, and help when use archery.
PHP Code:
[EVENTS E_ARCHERY_SYSTEM]
ON=@ITEMEQUIP
IF STRMATCH(*BOW*,<ACT.TYPE>)
 
FINDLAYER.6.UNEQUIP
 FINDLAYER.7
.UNEQUIP
 FINDLAYER.19
.UNEQUIP
ENDIF 
Add this event to all players.

STEPS BEFORE CREATE A THREAD
- Check the revisions log;
- Use the search button and use the keywords of your problem;
- Check the WIKI;
- Create a thread.
08-28-2012 02:35 AM
Find all posts by this user Like Post Quote this message in a reply
Lazarus
Master
**

Posts: 352
Likes Given: 11
Likes Received: 7 in 6 posts
Joined: Jun 2012
Reputation: 1

Hybris Ultima Online

Post: #4
RE: Unequip gloves, arms, and help when use archery.
(08-27-2012 08:44 PM)Shaklaban Wrote:  
PHP Code:
[typedef t_weapon_bow]
on=@equip
src
.unequip_helm_gloves

[typedef t_weapon_xbow]
on=@equip
src
.unequip_helm_gloves


[function unequip_helm_gloves]
for 
6 7
if (<findlayer.<local._for>>)
   if (<
findlayer.<local._for>.isavaiblewitharchery> = 0)
        
findlayer.<local._for>.cont=<findlayer.layer_pack>
   endif
endif
endfor
  

[
typedef t_armor]
on=@equiptest
if ((<findlayer.layer_hand2.type> = t_weapon_bow) || (<findlayer.layer_hand2.type> = t_weapon_xbow))
    if (<
isavaiblewitharchery> = 0)
        return 
1
    
endif
endif
 

[function 
isavaiblewitharchery]
if <
type> != t_armor
    
return 1
else
     
local.dispidsi=<serv.itemdef.<baseid>.dispid//aganist flipping
     
if (<serv.itemdef.<local.dispidsi>.tag0.noarchery> = 1//with that line you don't need to add tag.noarchery to gold, blackrock etc. items
         
return 0
    
endif
endif
return 
1


//example item def.

[ITEMDEF 01412]
DEFNAME=i_platemail_helm
TYPE
=T_ARMOR
FLIP
=1
RESOURCES
=15 i_ingot_iron
WEIGHT
=10
ARMOR
=40
REQSTR
=60
CATEGORY
=Provisions Armor
SUBSECTION
=Platemail Armor
DESCRIPTION
=Platemail Helm
DUPELIST
=01419
SKILLMAKE
=BLACKSMITHING 62.6
TAG
.NOARCHERY=//NO ARCHERY

ON=@Create
COLOR
=color_o_iron
HITPOINTS
={50 60

Code:
13:51:ERROR:(sphere_types.scp,396)Can't resolve <findlayer.layer_hand2.type>
13:51:ERROR:(sphere_types.scp,396)Can't resolve <findlayer.layer_hand2.type>
13:51:ERROR:(sphere_types.scp,396)Undefined symbol ''
13:51:ERROR:(sphere_types.scp,396)Undefined symbol ''

Happend this when i try with arms, gloves and helm.

Only works with the helm Sad
and, when I equip bow, the helm works, unequips, but, i can equip it again and then have: bow and helm.


Lazarus.

Thanks :!

[Image: 2hy9q0y.png]
08-28-2012 02:53 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
darksun84
Sir Spamalot
****

Posts: 1,687
Likes Given: 245
Likes Received: 162 in 151 posts
Joined: Mar 2012
Reputation: 35



Post: #5
RE: Unequip gloves, arms, and help when use archery.
Try with @EquiptTest
08-31-2012 11:58 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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