SphereCommunity
@SkillMakeItem weird problem - Printable Version

+- SphereCommunity (https://forum.spherecommunity.net)
+-- Forum: Sphere 0.56d (/Forum-Sphere-0-56d)
+--- Forum: Script Help (/Forum-Script-Help)
+--- Thread: @SkillMakeItem weird problem (/Thread-SkillMakeItem-weird-problem)



@SkillMakeItem weird problem - Tyxn - 10-28-2017 06:25 AM

im trying to figure it out how @SkillMakeItem is working. ARGO is the item that the item was crafted from. But sometimes <argo.baseid> give me the item that was crafted. im using the latest 56d build

EDIT= if i move an item and after that make an item argo.baseid give me what i move

sorry for my english Sad


RE: @SkillMakeItem weird problem - darksun84 - 10-28-2017 06:10 PM

That seems a bug!

Well i can't reproduce it, can you post your script?


RE: @SkillMakeItem weird problem - Tyxn - 10-28-2017 07:33 PM

Code:
[defname armor_resistance]
res_blackrock_min    7
res_blackrock_max    13


[events e_crafting]
on=@SkillMakeItem
local.lenght = <eval STRLEN(<argo.baseid>)>
local.ingot = <strsub 8 <dlocal.lenght> <argo.baseid>>
local.maxRes = <def.res_<local.ingot>_max>
local.minRes = <def.res_<local.ingot>_min>
local.dif = <eval <eval <local.maxres>>-<eval <local.minres>>>
local.Dorand1 = 2
local.dorand = 1
for 1 <dlocal.dif>
    local.Dorand += <eval <local.dorand1>>
    local.dorand1 ++
endfor
local.dec = 0
local.resno = 0
for 1 <eval <eval <local.dif>>+1>
    for 1 <dlocal._for>
        local.res<dlocal.resno> = <eval <eval <def.res_blackrock_max>>-<eval <local.dec>>>
        local.resno ++
    endfor
    if (<eval <local.dec>> <=5)
        local.dec ++
    endif
endfor
dorand <dlocal.dorand>
    act.resphysical=<dlocal.res0>
    act.resphysical=<dlocal.res1>
    act.resphysical=<dlocal.res2>
    act.resphysical=<dlocal.res3>
    act.resphysical=<dlocal.res4>
    act.resphysical=<dlocal.res5>
    act.resphysical=<dlocal.res6>
    act.resphysical=<dlocal.res7>
    act.resphysical=<dlocal.res8>
    act.resphysical=<dlocal.res9>
    act.resphysical=<dlocal.res10>
    act.resphysical=<dlocal.res11>
    act.resphysical=<dlocal.res12>
    act.resphysical=<dlocal.res13>
    act.resphysical=<dlocal.res14>
    act.resphysical=<dlocal.res15>
    act.resphysical=<dlocal.res16>
    act.resphysical=<dlocal.res17>
    act.resphysical=<dlocal.res18>
    act.resphysical=<dlocal.res19>
    act.resphysical=<dlocal.res20>
    act.resphysical=<dlocal.res21>
    act.resphysical=<dlocal.res22>
    act.resphysical=<dlocal.res23>
    act.resphysical=<dlocal.res24>
    act.resphysical=<dlocal.res25>
    act.resphysical=<dlocal.res26>
    act.resphysical=<dlocal.res27>
enddo
act.timerf 1,color = <act.color>
at the and i use act.timerf 1,color = <act.color> cuz created item tooltip doesnt update and i cant find another way


RE: @SkillMakeItem weird problem - darksun84 - 10-28-2017 07:58 PM

I think you can change this part:

Code:
[defname armor_resistance]
res_blackrock_min    7
res_blackrock_max    13

on=@SkillMakeItem
local.lenght = <eval STRLEN(<argo.baseid>)>
local.ingot = <strsub 8 <dlocal.lenght> <argo.baseid>>
with this and achieve the same:

Code:
[defname armor_resistance]
res_i_ingot_blackrock_min    7
res_i_ingot_blackrock_max    13

ON=@SkillMakeItem
local.lingot= <serv.itemdef.<act.baseid>.resources.0.key>
local.maxRes = <def.res_<local.lingot>_max>
local.minRes = <def.res_<local.lingot>_min>



RE: @SkillMakeItem weird problem - Tyxn - 10-28-2017 08:33 PM

it works and i think its better thanks darksun84 Smile


RE: @SkillMakeItem weird problem - darksun84 - 10-28-2017 08:43 PM

Here it seems to work fine, but i tried with bowcrafting and not with blacksmithing Confused