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
Cutting up monster bodies
Author Message
XuN
Sphere Developer
*****

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



Post: #31
RE: Cutting up monster bodies
Its nice to see people trying to improve their scripts this way, I hope this help you a bit.

Code:
IF (<ARGO.TYPE> == T_CORPSE) && (<IsWeapon>) // if this is a corpse and is being used a sharped weapon
    //If (<SRC.ISNEARTYPE <argo.type> 2>)    // if you target this body in 16 tiles distance but you have another body in 2 distance you'll pass this check
    if (<SRC.Distance <argo>> > 2)
        SRC.SysMessage=You must be near the corpse to carve it.
        return 1    // try to return executions ASAP.
    endif
    if (<argo.timestamp>==0)
        return 0
    endif
    //if (<argo.timestamp>)    // checking above the timestamp == 0 that you had under this code you stopped the code in this case, so you have now one less check.
    argo.timestamp=0
    f_skinning_try    // Skinning_try is executing no matter you have more than required skill or less, no need a check for it then
    if (<EVAL <DEF.SKIN_C_<SERV.CHARDEF.<eval <ARGO.MOREX>+<ARGO.MOREY>>.name.more1>>> >= <src.skinning>)    //Instead we call that check here just to see if we success or not, depending on the skill
        if (<r<EVAL <DEF.SKIN_C_<SERV.CHARDEF.<eval <ARGO.MOREX>+<ARGO.MOREY>>.name.more1>>>> > <src.skinning>)
            if (<R5> == 1)
                local.success=1    // and store the success to do not repeat the same code twice.
            endif
        endif
    elif (<EVAL <DEF.SKIN_C_<SERV.CHARDEF.<eval <ARGO.MOREX>+<ARGO.MOREY>>.name.more1>>> < <src.skinning>)
        if (<r<EVAL <DEF.SKIN_C_<SERV.CHARDEF.<eval <ARGO.MOREX>+<ARGO.MOREY>>.name.more1>>>> < <src.skinning>/5)
            local.success=1
        endif
    endif
    if (<local.success>==1)    // So we can call the success here once, if needed.
        f_skinning_success
        if (<src.skilltotal> < <src.skillclass.skillsum>)
            if (<src.skinning> < <src.skillclass.<serv.skill.skinning.key>>)
                if (<r<src.skinning>> <= 10) // gain skill chance
                    src.skinning += 1        // Can't remember now, but AFAIR .skillgain skinning (or something like that) can force an instant skillgain.
                    src.sysmessage @0120, Your skill in Skinning has increased by 0.1%. It is now <src.skinning>%
                endif
            endif
        endif
    else
        f_skinning_fail
    endif
else
    return 0
ENDIF

BTW, instead of assigning a def to each character ... maybe you find better to create a 'formula', based on mob stats in example, in the @DeathCorpse storing a tag.skinning=value in the corpse.

Something like this (just as example formula, can be hardly improved):
Code:
[function f_skinning_value]
return <eval (<str>+<dex>+<int>+<maxhits>+<maxmana>+<maxstam>+(<skilltotal>/20))/10>
06-08-2014 06:30 PM
Find all posts by this user Like Post Quote this message in a reply
[+] 1 user Likes XuN's post
Post Reply 


Messages In This Thread
Cutting up monster bodies - kn4tseb - 06-04-2014, 02:53 PM
RE: Cutting up monster bodies - Extreme - 06-04-2014, 03:12 PM
RE: Cutting up monster bodies - kn4tseb - 06-04-2014, 04:34 PM
RE: Cutting up monster bodies - Extreme - 06-05-2014, 02:00 AM
RE: Cutting up monster bodies - kn4tseb - 06-05-2014, 04:48 AM
RE: Cutting up monster bodies - Extreme - 06-05-2014, 05:05 AM
RE: Cutting up monster bodies - kn4tseb - 06-05-2014, 05:14 AM
RE: Cutting up monster bodies - darksun84 - 06-05-2014, 06:12 AM
RE: Cutting up monster bodies - kn4tseb - 06-05-2014, 06:15 AM
RE: Cutting up monster bodies - Extreme - 06-05-2014, 07:22 AM
RE: Cutting up monster bodies - kn4tseb - 06-05-2014, 02:47 PM
RE: Cutting up monster bodies - Extreme - 06-06-2014, 01:41 AM
RE: Cutting up monster bodies - kn4tseb - 06-06-2014, 02:18 AM
RE: Cutting up monster bodies - kn4tseb - 06-06-2014, 08:55 AM
RE: Cutting up monster bodies - Extreme - 06-06-2014, 12:52 PM
RE: Cutting up monster bodies - kn4tseb - 06-06-2014, 01:52 PM
RE: Cutting up monster bodies - Extreme - 06-06-2014, 02:13 PM
RE: Cutting up monster bodies - kn4tseb - 06-06-2014, 02:14 PM
RE: Cutting up monster bodies - Mordaunt - 06-06-2014, 04:45 PM
RE: Cutting up monster bodies - XuN - 06-06-2014, 10:50 PM
RE: Cutting up monster bodies - kn4tseb - 06-07-2014, 12:14 AM
RE: Cutting up monster bodies - kn4tseb - 06-07-2014, 05:40 AM
RE: Cutting up monster bodies - kn4tseb - 06-07-2014, 07:41 AM
RE: Cutting up monster bodies - Extreme - 06-07-2014, 08:20 AM
RE: Cutting up monster bodies - kn4tseb - 06-07-2014, 11:15 AM
RE: Cutting up monster bodies - Extreme - 06-07-2014, 12:02 PM
RE: Cutting up monster bodies - kn4tseb - 06-07-2014, 02:21 PM
RE: Cutting up monster bodies - kn4tseb - 06-07-2014, 05:17 PM
RE: Cutting up monster bodies - kn4tseb - 06-08-2014, 08:17 AM
RE: Cutting up monster bodies - XuN - 06-08-2014 06:30 PM
RE: Cutting up monster bodies - kn4tseb - 06-09-2014, 02:44 AM

Forum Jump:


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