SphereCommunity
Improved Stables - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Submissions (/Forum-Script-Submissions)
+--- Thread: Improved Stables (/Thread-Improved-Stables)

Pages: 1 2 3


RE: Improved Stables - darksun84 - 10-27-2014 03:21 AM

good job mordaunt


RE: Improved Stables - Extreme - 10-27-2014 09:46 PM

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 



RE: Improved Stables - Coruja - 10-28-2014 05:07 AM

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


RE: Improved Stables - XuN - 10-28-2014 05:58 PM

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.


RE: Improved Stables - Extreme - 10-28-2014 08:19 PM

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?


RE: Improved Stables - Mordaunt - 10-29-2014 06:19 AM

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.


RE: Improved Stables - XuN - 10-29-2014 07:34 AM

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).


RE: Improved Stables - admin phoenix - 10-30-2014 09:18 PM

check out my system
I store the pets in the container of the stabler Smile
maybe you can use it.


RE: Improved Stables - Mordaunt - 10-30-2014 11:57 PM

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.


RE: Improved Stables - admin phoenix - 10-30-2014 11:59 PM

so why should a npc vendor not be invul????