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
kn4tseb
Master
**

Posts: 392
Likes Given: 45
Likes Received: 10 in 10 posts
Joined: May 2014
Reputation: 0



Post: #32
RE: Cutting up monster bodies
Thanks XuN!! Smile totally improved! gonna updated and try a new formula ^^
06-09-2014 02:44 AM
Find all posts by this user Like Post Quote this message in a reply
amonvangrell
Banned

Posts: 338
Likes Given: 17
Likes Received: 32 in 20 posts
Joined: Aug 2012

britannia shard

Post: #33
RE: Cutting up monster bodies
That's what I am talking about! Big Grin
06-09-2014 08:26 AM
Visit this user's website Find all posts by this user Like Post Quote this message in a reply
Post Reply 


Forum Jump:


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