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:
  • 1 Votes - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Negotiate Features - AssistUO/Razor
Author Message
Extreme
Grandmaster Poster
***

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

SphereCommunity

Post: #1
Negotiate Features - AssistUO/Razor
Hello guys!
Good news for you all...
A month ago I asked the community if someone could help me to make work the Negotiate Features with Server of AssistUO/Razor on our beloved sphere.

One guy named Feeh, my old friend helped me.
I want to give him 50% of the credits for the code because without his help with the sendpacket I wouldn't finish it.
Others 50% would go to me Tongue hahahaha
Can't forget Diego and Diogo from making the AssistUO, thats a VERY GOOD player assistant and release the MAPUO Protocol code, that will work with the code I will share.

Okay, let me explain how it works.
Do you remember the light, sound, music, season, weather filters on Razor?
Right, they are present on AssistUO too.
But with the right code, we can block them, so you will have your players always playing as you want to.

MapUO Protocol - Created by Diego (MapUO code) and modified by me to work the Negotiate Features.
PHP Code:
// MAPUO PROTOCOL SUPPORT
// AUTHOR: DIEGO@RUNUO.COM
// LAST UPDATE: 11/04/2013
// LAST UPDATE: 10/09/2013 - EXTREME
//
// INSTRUCTIONS:
//
// OPEN SPHERE.INI AND INSERT THE FOLLOWING LINE:
// PACKET240=F_HANDLER_EXTENDEDPROTOCOL
//
// RESTART OR RESYNC THE SERVER IF NECESSARY.
// YOU CAN ADJUST THE FOLLOWING DEFS AS YOU WISH

[DEFNAME MAPUO_SETTINGS]
MAPUO_PARTY_ENABLED            1
MAPUO_GUILD_ENABLED            1
MAPUO_GUILD_HITPOINTS          1
MAPUO_GUILD_DISABLETAG         MAPUO_INVISIBLE
NEGOTIATE_FEATURES_ENABLED    1

[DEFNAME FEATURES]    // 1 = BLOCK | 0 = ALLOW
FEATURE.1        1,FilterWeather        //= 1 << 0,        // Weather filter
FEATURE.2        1,FilterLight        //= 1 << 1,        // Light filter
FEATURE.3        1,SmartTarget        //= 1 << 2,        // Smart targeting option
FEATURE.4        1,RangedTarget        //= 1 << 3,        // Range check for targeting option
FEATURE.5        0,AutoOpenDoors        //= 1 << 4,        // Automatically open doors
FEATURE.6        0,DequipOnCast        //= 1 << 5,        // Clear hands before casting
FEATURE.7        0,AutoPotionEquip    //= 1 << 6,        // Dequip and equip hands for potions
FEATURE.8        0,PoisonedChecks    //= 1 << 7,        // Poisoned checks for macros and block heal if poisoned option
FEATURE.9        0,LoopedMacros        //= 1 << 8,        // Looped macros
FEATURE.10        0,UseOnceAgent        //= 1 << 9,        // Use once agent and command
FEATURE.11        0,RestockAgent        //= 1 << 10,    // Restock agent
FEATURE.12        0,SellAgent            //= 1 << 11,    // Vendor sell agent
FEATURE.13        0,BuyAgent            //= 1 << 12,    // Vendor buy agent
FEATURE.14        0,PotionHotkeys        //= 1 << 13,    // Potions hotkeys
FEATURE.15        0,RandomTargets        //= 1 << 14,    // Random targeting hotkeys and commands
FEATURE.16        0,ClosestTargets    //= 1 << 15,    // Closest targeting hotkeys and commands
FEATURE.17        0,OverheadHealth    //= 1 << 16,    // Display health percentage over head
FEATURE.18        1,AutolootAgent        //= 1 << 17,    // Autoloot agent
FEATURE.19        1,BoneCutterAgent    //= 1 << 18,    // Bone cutter agent
FEATURE.20        1,AdvancedMacros    //= 1 << 19,    // Advanced macros engine
FEATURE.21        0,AutoRemount        //= 1 << 20,    // Automatically remound after dismount
FEATURE.22        1,AutoBandage        //= 1 << 21,    // Automatically apply bandages
FEATURE.23        1,BuffChecks        //= 1 << 22,    // Buff bar checks for macros
FEATURE.24        1,FilterSeason        //= 1 << 23,    // Season filter

[DIALOG D_NEGOTIATE_FEATURES]
0,0
NOMOVE
NOCLOSE
GUMPPICTILED 0 0 806 606 2624
CHECKERTRANS 0 0 806 606

[FUNCTION F_FEATURES]
LOCAL.FEATURES 0
SERV
.LOG SETTING THE FEATURES TO NEGOTIATE
FOR I 1 24
 
IF <GETARGVX 1,<DEF.FEATURE.<dLOCAL.I>>> == 1
  LOCAL
.FEATURES |= <HVAL 2@(<dLOCAL.I>-1)>
  
SERV.LOG - <GETARGVX 2,<DEF.FEATURE.<dLOCAL.I>>>
 ENDIF
ENDFOR
SERV.LOG NEGOTIATE FEATURES SET <STRTOUPPER <LOCAL.FEATURES>>
VAR.
FEATURES <LOCAL.FEATURES>
RETURN 
1

[FUNCTION F_NEGOTIATE_FEATURES]
SDIALOG D_NEGOTIATE_FEATURES
TAG
.NEGOTIATEFEATURES 1
FLAGS 
|= STATF_FREEZE
SENDPACKET 0F0 00 0C 0FE D00 D
<VAR.FEATURES>
SYSMESSAGE @063,,1 To play hereyou must use AssistUO or Razor and have 'Negotiate Features with Server' enabled. If it's disabled, you have 8 seconds to enable it or will be disconnected in 10 seconds.
TIMERF 8,SENDPACKET 0F0 00 0C 0FE D00 D<VAR.FEATURES>
TIMERF 10,F_NEGOTIATE_FEATURES_2
RETURN 1

[FUNCTION F_NEGOTIATE_FEATURES_2]
IF <dTAG.NEGOTIATEFEATURES>
 FLAGS &= ~STATF_FREEZE
 SYSMESSAGE @026,,1 You must activate '
Negotiate Features with Server' in your assistant to play.
 IF <ISONLINE>
  SENDPACKET 082 04
 ENDIF
ENDIF
RETURN 1

[FUNCTION F_NEGOTIATE_FEATURES_3]
TAG.NEGOTIATEFEATURES
FLAGS &= ~STATF_FREEZE
TRYSRC <UID> DIALOGCLOSE D_NEGOTIATE_FEATURES
SYSMESSAGE @044,,1 You negotiated the features with server and you'
re ready to play.
UPDATEX
RETURN 1

[FUNCTION F_HANDLER_EXTENDEDPROTOCOL]
IF (<
dLOCAL.NUM> <= 8)
 
REF1 <LOCAL.CHAR>
 IF (<
dARGN1> != 240)
  RETURN 
1
 
ELSEIF (<dLOCAL.3> == 255) && (<REF1.dTAG.NEGOTIATEFEATURES>)
  
REF1.F_NEGOTIATE_FEATURES_3
 
ELSEIF (<dLOCAL.3> == 0) && (<dDEF.MAPUO_PARTY_ENABLED> == 1)
  
REF1.F_MAPUO_HANDLE_PARTY
 
ELSEIF (<dLOCAL.3> == 1) && (<dDEF.MAPUO_GUILD_ENABLED> == 1)
  
REF1.F_MAPUO_HANDLE_GUILD <dLOCAL.4>
 ENDIF
 RETURN 
1
ENDIF

[FUNCTION 
F_MAPUO_HANDLE_PARTY]
IF !<
ISINPARTY>
 RETURN
ENDIF
LOCAL.DATA = <HVAL 01>
LOCAL.COUNT 0
FOR X 0 <EVAL <PARTY.MEMBERS> - 1>
 
REF1 = <PARTY.MEMBER.<DLOCAL.X>>
 IF (<
REF1>) && (<REF1> != <UID>) && (<DISTANCE <REF1>> >= 18)
  
LOCAL.COUNT ++
  
LOCAL.DATA = <LOCAL.DATAD<HVAL <REF1.UID>> W<HVAL <REF1.P.X>> W<HVAL <REF1.P.Y>> <HVAL <REF1.MAP>>
 ENDIF
ENDFOR
IF <
DLOCAL.COUNT> > 0
 LOCAL
.DATA = <LOCAL.DATAD<HVAL 00>
 
LOCAL.LENGTH = <EVAL + (<LOCAL.COUNT> * 9) + 4>
 
SENDPACKET 0F0 W<HVAL <LOCAL.LENGTH>> <LOCAL.DATA>
ENDIF

[FUNCTION 
F_MAPUO_HANDLE_GUILD]
IF !<
GUILD>
 
SENDPACKET 0F0 W<HVAL 9> <HVAL 2> <HVAL 0D<HVAL 00>
 RETURN
ENDIF
LOCAL.DATA = <HVAL 02> <HVAL <ARGN1>>
LOCAL.COUNT 0
FOR X 0 <EVAL <GUILD.MEMBER.COUNT> - 1>
 
REF1 = <GUILD.MEMBER.<DLOCAL.X>.UID>
 IF (<
REF1>) && (<REF1> != <UID>) && (<REF1.ISONLINE>) && (<DREF1.TAG0.<DEF.MAPUO_GUILD_DISABLETAG>> == 0)
  IF (<
DARGN1> == 0) || ((<DARGN1> == 1) && (<DISTANCE <REF1>> >= 18))
   
LOCAL.COUNT ++
   
LOCAL.DATA = <LOCAL.DATAD<HVAL <REF1.UID>> 
   IF (<
DARGN1> == 1)
    
LOCAL.DATA = <LOCAL.DATAW<HVAL <REF1.P.X>> W<HVAL <REF1.P.Y>> <HVAL <REF1.MAP>> <HVAL <REF1.F_MAPUO_HITSPERCENT>>
   ENDIF
  ENDIF
 ENDIF
ENDFOR
LOCAL.DATA = <LOCAL.DATAD<HVAL 00>
IF (<
DARGN1> == 0)
 
LOCAL.LENGTH = <EVAL + (<LOCAL.COUNT> * 4) + 4>
ELSE
 
LOCAL.LENGTH = <EVAL + (<LOCAL.COUNT> * 10) + 4>
ENDIF
SENDPACKET 0F0 W<HVAL <LOCAL.LENGTH>> <LOCAL.DATA>

[FUNCTION 
F_MAPUO_HITSPERCENT]
IF (<
dDEF.MAPUO_GUILD_HITPOINTS>) && (<MAXHITS> > 0)
 RETURN <
FEVAL <FLOATVAL (<HITS> / <MAXHITS>) * 100>>
ELSE
 RETURN 
0
ENDIF

[
EOF


PHP Code:
[FUNCTION F_ONSERVER_START]
F_FEATURES 

On Sphere_skills.scp
PHP Code:
ON=@LOGIN
IF <dDEF.NEGOTIATE_FEATURES_ENABLED> == 1
 F_NEGOTIATE_FEATURES
ENDIF 

If you don't have this function, copy it.
PHP Code:
[PLEVEL 7]
GETARGVX

[FUNCTION GETARGVX]
IF <
ARGV[0]> == -1
 
RETURN <EVAL <ARGV>-1>
ELSE
 RETURN <
ARGV[<ARGV[0]>]>
ENDIF

[
EOF

Quick Guide
- Add the "PACKET240=F_HANDLER_EXTENDEDPROTOCOL" on Sphere.ini;
- Add the "F_FEATURES" function on Sphere_serv_triggers.scp;
- Add the "F_NEGOTIATE_FEATURES" on @Login in Sphere_skills.scp;
- Set what you want to block/allow on DEFNAMES and save; (Note: the features will be calculated on F_FEATURES, so it will be calculated on F_ONSERVER_START or you can use .F_FEATURES)
- To login, use AUO or Razor with the 'Negotiate features with server' enabled;
- Give me millions of +rep;
- Enjoy.

Edit: added defname to enable/disable the negotiate features.

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.
(This post was last modified: 09-23-2013 05:02 AM by Extreme.)
09-18-2013 09:27 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 4 users Like Extreme's post
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #2
RE: Negotiate Features - AssistUO/Razor
Just one word: EPIC
09-18-2013 09:48 AM
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: #3
RE: Negotiate Features - AssistUO/Razor
Nice job
09-18-2013 09:56 AM
Find all posts by this user Like Post Quote this message in a reply
Soulless
Super Moderator
****

Posts: 335
Likes Given: 29
Likes Received: 49 in 27 posts
Joined: Jun 2012
Reputation: 12

Ye Olde Sphere

Post: #4
RE: Negotiate Features - AssistUO/Razor
This is really good. well done sir.

What am I working on?
09-18-2013 09:59 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #5
RE: Negotiate Features - AssistUO/Razor
I asume this is about them (AssistUO) but if you tick Light filter and then log in you get the light filter even if you blocked it, but in this moment you can't tick it out.

And dunno if I'm doing anything wrong (instructions about installing it are very simple) but I can't do more than few steps upon login, I must move using teleports!
09-18-2013 05:35 PM
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: #6
RE: Negotiate Features - AssistUO/Razor
(09-18-2013 05:35 PM)XuN Wrote:  I asume this is about them (AssistUO) but if you tick Light filter and then log in you get the light filter even if you blocked it, but in this moment you can't tick it out.

And dunno if I'm doing anything wrong (instructions about installing it are very simple) but I can't do more than few steps upon login, I must move using teleports!
Oh, just forgot the UPDATEX on the player.
Code updated.
Thanks XuN.

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.
09-18-2013 08:36 PM
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: #7
RE: Negotiate Features - AssistUO/Razor
Well.. no one else has posted anything so I guess it's just me but....

Code:
05:39:(negotiate.scp,55)SETTING THE FEATURES TO NEGOTIATE
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,FilterWeather>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,FilterLight>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,SmartTarget>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,RangedTarget>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,AutoOpenDoors>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,DequipOnCast>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,AutoPotionEquip>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,PoisonedChecks>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,LoopedMacros>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,UseOnceAgent>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,RestockAgent>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,SellAgent>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,BuyAgent>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,PotionHotkeys>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,RandomTargets>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,ClosestTargets>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,OverheadHealth>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,AutolootAgent>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,BoneCutterAgent>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,AdvancedMacros>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,0,AutoRemount>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,AutoBandage>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,BuffChecks>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:ERROR:(negotiate.scp,57)Can't resolve <GETARGVX 1,1,FilterSeason>
05:39:ERROR:(negotiate.scp,57)Undefined symbol ''
05:39:(negotiate.scp,62)NEGOTIATE FEATURES SET 00

Took 7 steps ingame after it allowed me in and then it froze up...

Your UPDATEX does not solve the walking issue...
Just tried it.

[Image: 2nis46r.jpg]
(This post was last modified: 09-18-2013 08:46 PM by Mordaunt.)
09-18-2013 08:42 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: #8
RE: Negotiate Features - AssistUO/Razor
(09-18-2013 08:42 PM)Mordaunt Wrote:  Well.. no one else has posted anything so I guess it's just me but....

Took 7 steps ingame after it allowed me in and then it froze up...

Your UPDATEX does not solve the walking issue...
Just tried it.
Updated the first post with GETARGVX function, so you can get it there.
Whats the walking issue?

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.
09-19-2013 01:01 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: #9
RE: Negotiate Features - AssistUO/Razor
Sphere build: Sep 15 2013 (00:05:19), internal build #1626

UO Client: 7.0.32.11

Razor: 1.0.13

Errors fixed now.
However same issue as Xun.... take 7 to 11 steps and then unable to move anymore
Can talk, cast e.t.c..
Teleporting to a new location frees the player up for another 7 to 11 steps then same issue

[Image: 2nis46r.jpg]
09-19-2013 01:26 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
XuN
Sphere Developer
*****

Posts: 852
Likes Given: 102
Likes Received: 156 in 119 posts
Joined: Jul 2013
Reputation: 30



Post: #10
RE: Negotiate Features - AssistUO/Razor
Yes, the problem is only that, we can everything except moving. I also had the getargvx error, but I changed with my function and forgot about it Tongue
09-19-2013 01:59 AM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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