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
Improved Stables
Author Message
darksun84
Sir Spamalot
****

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



Post: #11
RE: Improved Stables
good job mordaunt
10-27-2014 03:21 AM
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: #12
RE: Improved Stables
Hey mord, just an idea...

PHP Code:
[FUNCTION f_char_clean]
REF1 <UID>
FOR 
<EVAL <serv.list.<REF1>_stabled.count>-1>
 
REF2 <serv.list.<REF1>_stabled.<dlocal._for>>
 IF (<
SERV.UID.<REF2>>)
  
REF2.REMOVE
 
ENDIF
ENDFOR
serv.list.<REF1>_stabled.clear

[FUNCTION f_account_clean]
FOR 
<EVAL <serv.list.<args>_stabled.count>-1>
 
REF2 <serv.list.<args>_stabled.<dlocal._for>>
 IF (<
SERV.UID.<REF2>>)
  
REF2.REMOVE
 
ENDIF
ENDFOR
serv.list.<args>_stabled.clear 

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.
10-27-2014 09:46 PM
Find all posts by this user Like Post Quote this message in a reply
Coruja
Sphere Developer
*****

Posts: 987
Likes Given: 5
Likes Received: 226 in 187 posts
Joined: Jul 2012
Reputation: 7

Dimension Shard

Post: #13
RE: Improved Stables
yesterday I made some improvements on stables internal behavior, now it have more messages and improved checks when you target a pet

also now it uses the OSI formula to calculate the max pets that a player can stable. If someone need it:
Code:
LOCAL.SkillSum = <eval <TAMING>+<ANIMALLORE>+<VETERINARY>>  //Player skills
IF (<LOCAL.SkillSum> >= 2400)
  LOCAL.PetMax = 5
ELIF (<LOCAL.SkillSum> >= 2000)
  LOCAL.PetMax = 4
ELIF (<LOCAL.SkillSum> >= 1600)
  LOCAL.PetMax = 3
ELSE
  LOCAL.PetMax = 2
ENDIF

IF (<TAMING> >= 1000)
  LOCAL.PetMax += <eval (<TAMING>-900)/100)
ENDIF
IF (<ANIMALLORE> >= 1000)
  LOCAL.PetMax += <eval (<ANIMALLORE>-900)/100)
ENDIF
IF (<VETERINARY> >= 1000)
  LOCAL.PetMax += <eval (<VETERINARY>-900)/100)
ENDIF
PS: if TAG.MAXPLAYERPETS is set on the NPC, it will override this formula
10-28-2014 05:07 AM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes Coruja's post
XuN
Sphere Developer
*****

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



Post: #14
RE: Improved Stables
You should change it from tag to a variable in CChar_Props.tbl and then use SetDefNum and GetDefNum to access it.

And, to give out one idea, you can add also a new max total storage pets (from all the players) to replace the current BankMaxItems hence making it some more easy to customize.
10-28-2014 05:58 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: #15
RE: Improved Stables
I'm using this system but storing the pets on bank or backpack of player is sucks. There isn't a way to put them in memory?

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.
10-28-2014 08:19 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: #16
RE: Improved Stables
I tried putting them in memory when I first started on the script, it didn't turn out very well.
Though I admit the method of storing them in banks and backpacks sucks, it was a means to an end at the time.

[Image: 2nis46r.jpg]
10-29-2014 06:19 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: #17
RE: Improved Stables
Did you try to setup a Layer to use it as container?? Something like:

Code:
[DEFNAME layers]
..
..

layer_stable = 55

[function f_store_pet]
ref1=<findlayer.layer_stable>
if !(<ref1>)
serv.newitem=i_backpack
new.attr=attr_newbie
new.cont=<uid>
ref1=<new>
endif
ref2=<f_your_shrink>
ref2.cont=<ref1>

Creating a container on this layer and inserting items inside should work, take in count that it will have container's limitations (255 items).
10-29-2014 07:34 AM
Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #18
RE: Improved Stables
check out my system
I store the pets in the container of the stabler Smile
maybe you can use it.
(This post was last modified: 10-30-2014 11:57 PM by Mordaunt.)
10-30-2014 09:18 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: #19
RE: Improved Stables
I don't think I did that Xun no... but it's been so long since I did it I dont really recall.
I might look at redoing that bit, once I reinstall.....

Admin Pheonix, storing the animals on the stabler still results in lost pets if the stabler is lost/killed.

[Image: 2nis46r.jpg]
10-30-2014 11:57 PM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
admin phoenix
Master
**

Posts: 354
Likes Given: 1
Likes Received: 23 in 13 posts
Joined: Mar 2012
Reputation: 3



Post: #20
RE: Improved Stables
so why should a npc vendor not be invul????
10-30-2014 11:59 PM
Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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