Sign in to follow this  
Followers 0
Rinor

Admiral Cloak

7 posts in this topic

Using Admiral Cloak Scripts from @KONG release..

When im using the cape and using Poss, the max gets stuck.. i need to remove cape and put it again, do it same for pet and use ticket or teleport to refresh stats, is there any idea of this? i need help..

Share this post


Link to post
Share on other sites

you can add in pet script if cape slot cape true refresh cape stat..

Share this post


Link to post
Share on other sites
On 4/9/2018 at 7:53 AM, Onioni said:

you can add in pet script if cape slot cape true refresh cape stat..

Can you give me an example of refresh thing, im using a custom Elf system for pets which uses hooks and i hope there isn't a confflict between elf hooks and cape ones.. any idea?

Share this post


Link to post
Share on other sites

Posted (edited)

9 hours ago, Rinor said:

Can you give me an example of refresh thing, im using a custom Elf system for pets which uses hooks and i hope there isn't a confflict between elf hooks and cape ones.. any idea?

You need add it in fairy posse script to refresh it same way then it refresh possession. Sorry im not im pc, i don't have script ... 

Edited by Onioni

Share this post


Link to post
Share on other sites
21 hours ago, Onioni said:

You need add it in fairy posse script to refresh it same way then it refresh possession. Sorry im not im pc, i don't have script ... 

Ic, i hope you could give me a example of script to refresh it anytime you get in pc or smth..

Share this post


Link to post
Share on other sites

I still need help with this problem, this is Admiral Cloak Scripts ( @KONG Cloak )
in AttrCalculate.lua at

function Creat_Item(item, item_type, item_lv, item_event) 

under

local i = 0 
local Num = 0

i put this:

	if GetItemID(item) == cloak.conf.itemId then
            Add_Item_Attr(ITEMATTR_VAL_STR, 0)
            Add_Item_Attr(ITEMATTR_VAL_CON, 0)
            Add_Item_Attr(ITEMATTR_VAL_AGI, 0)
            Add_Item_Attr(ITEMATTR_VAL_STA, 0)
            Add_Item_Attr(ITEMATTR_VAL_DEX, 0)
	end	

in exp_and_level.lua at

function ShareTeamExp ( dead , team_atker , dead_exp , The_Killer)

i put this:

	if cloak ~= nil then
        if cloak.hasCloak(t[i]) == 1 then
            local cloakSlot = GetChaItem(t[i], 2, (cloak.conf['itemSlot'] - 1))
            if cloak.hasGem(cloakSlot, 63) == 1 then
                local gemLv = cloak.getGemLv(cloakSlot, 63);
                local multiplier = .05;
                multiplier = multiplier * gemLv;
                exp_up = exp_up + (exp_up * multiplier);
            end
        end
    end

in skilleffect.lua at

function Check_Baoliao(ATKER, DEFER, ... )

i put this:

    -- Cloak System:
    if cloak ~= nil then
        if cloak.hasCloak(ATKER) == 1 then
            local cloakSlot = GetChaItem(ATKER, 2, (cloak.conf['itemSlot'] - 1));
            if cloak.hasGem(cloakSlot, 64) == 1 then
                local gemLv = cloak.getGemLv(cloakSlot, 64);
                local multiplier = .05 * gemLv;
                mf = ((mf*100) + ((mf*100) * multiplier)) / 100;
            end
        end
    end		

and this is Cloak Scripts:
 

-- Cloak System
-------------------------------------------------------
 
 cloak = {};
    -- Cloak Upgrade Device: 7872
    -- 3611
    cloak.conf      = {
        itemId      = 3857,
        dustyId     = 7873,
        itemSlot    = 5,
        maxLv       = 10,
        statperLv   = 3
    };
    cloak.race      = {
        [1]         = 221,
        [2]         = 222,
        [3]         = 223,
        [4]         = 224
    };-- cloak.conf['statperLv']
 
    cloak.hook      = {
       tick        = cha_timer,
       melee       = Skill_Melee_End,
       range       = Skill_Range_End,
       bolt        = Skill_Xlcz_End,
       conch       = Skill_Bkcj_End
    };

    cloak.aId       = {
        [cloak.conf['itemId']] = true
    };
 
    cloak.upRate                = {};
        cloak.upRate[0]         = 1
        cloak.upRate[1]         = 1
        cloak.upRate[2]         = 1
        cloak.upRate[3]         = 1
        cloak.upRate[4]         = 1
        cloak.upRate[5]         = 1
        cloak.upRate[6]         = 1
        cloak.upRate[7]         = 1
		cloak.upRate[8]         = 1
		cloak.upRate[9]         = 1		
		cloak.upRate[10]         = 1		
 
    cloak.getCloakLv = function(item)
        local getLv = GetItemAttr(item, 55);
        if getLv > 0 then
            return getLv;
        end
        return 0;
    end
 
    cloak.hasCloak = function(cha)
        local slot = GetChaItem(cha, 2, (cloak.conf['itemSlot'] - 1));
        local slotId = GetItemID(slot);
        if slotId == cloak.conf['itemId'] then
            return 1;
        end
        return 0;
    end
 
    cloak.getGem = function(item)
        local chaCloak = {};
        local param = GetItemForgeParam(item, 1)
        --Notice(param);
        param = TansferNum(param)
        chaCloak[1] = GetNum_Part2(param)
        chaCloak[2] = GetNum_Part3(param)
        chaCloak[3] = GetNum_Part4(param)
        chaCloak[4] = GetNum_Part5(param)
        chaCloak[5] = GetNum_Part6(param)
        chaCloak[6] = GetNum_Part7(param)
        return chaCloak;
    end
 
    cloak.hasGem = function(item, stoneId)
        local gem = cloak.getGem(item);
        if gem[1] == stoneId or
            gem[3] == stoneId or
                gem[5] == stoneId then
            return 1;
        end
        return 0;
    end
 
    cloak.getGemLv = function(item, stoneId)
        local gem = cloak.getGem(item);
        if gem[1] == stoneId then
            return gem[2];
        end
        if gem[3] == stoneId then
            return gem[4];
        end
        if gem[5] == stoneId then
            return gem[6];
        end
    end
 
    -- Cloak System:
    if cloak ~= nil then
        if cloak.hasCloak(ATKER) == 1 then
            local cloakSlot = GetChaItem(ATKER, 2, (cloak.conf['itemSlot'] - 1));
            if cloak.hasGem(cloakSlot, 64) == 1 then
                local gemLv = cloak.getGemLv(cloakSlot, 64);
                local multiplier = .05 * gemLv;
                mf = ((mf*100) + ((mf*100) * multiplier)) / 100;
            end
        end
    end
 
    cloak.skill = function(ATKER, DEFER, sklv)
        if cloak.hasCloak(ATKER) == 1 then
            local cloakSlot = GetChaItem(ATKER, 2, (cloak.conf['itemSlot'] - 1));
            if cloak.hasGem(cloakSlot, 65) == 1 then
                local Percentage = Percentage_Random(.07)
                if Percentage == 1 then
                    local getStateLv = GetChaStateLv(DEFER, 214);
                    if getStateLv == 0 then
                        local gemLv = cloak.getGemLv(cloakSlot, 65);
                        AddState(ATKER, DEFER, 214, gemLv, 3);
                        local ret = gemLv * 5
                        --SystemNotice(ATKER, "Recieved bonus from Admiral Cloak. Target Physical Resistence reduce by "..ret.." for 3 sec")
                    end
                end
            end
            if cloak.hasGem(cloakSlot, 66) == 1 then
                local Percentage = Percentage_Random(.07)
                if Percentage == 1 then
                    local getStateLv = GetChaStateLv(DEFER, 215);
                    if getStateLv == 0 then
                        local gemLv = cloak.getGemLv(cloakSlot, 66);
                        AddState(ATKER, DEFER, 215, gemLv, 3);
                        local ret = gemLv * 50
                        --SystemNotice(ATKER, "Recieved bonus from Admiral Cloak. Target Defence reduce by "..ret.." for 3 sec")
                    end
                end
            end
            if cloak.hasGem(cloakSlot, 67) == 1 then
                local Percentage = Percentage_Random(.07)
                if Percentage == 1 then
                    local getStateLv = GetChaStateLv(DEFER, 216);
                    if getStateLv == 0 then
                        local gemLv = cloak.getGemLv(cloakSlot, 67);
                        AddState(ATKER, DEFER, 216, gemLv, 3);
                        local ret = gemLv * 10
                        --SystemNotice(ATKER, "Recieved bonus from Admiral Cloak. Target Dodge reduce by "..ret.." for 3 sec")
                    end
                end
            end
            if cloak.hasGem(cloakSlot, 68) == 1 then
                local Percentage = Percentage_Random(.07)
                if Percentage == 1 then
                    local getStateLv = GetChaStateLv(DEFER, 217);
                    if getStateLv == 0 then
                        local gemLv = cloak.getGemLv(cloakSlot, 68);
                        AddState(ATKER, DEFER, 217, gemLv, 3);
                        local ret = gemLv * 10
                        --SystemNotice(ATKER, "Recieved bonus from Admiral Cloak. Target Hitrate reduce by "..ret.." for 3 sec")
                    end
                end
            end
        end
    end
 
    ----------------------------------------------
    -- HOOKS:
    ----------------------------------------------
	cha_timer = function(role, freq, time)
	cloak.hook['tick'](role, freq, time)
        if IsPlayer(role) == 1 then
            -- PlayEffect(role, 319)
            local slot = GetChaItem(role, 2, (cloak.conf['itemSlot'] - 1));
            local slotId = GetItemID(slot);
            local raceId = GetChaTypeID(role);
            local state = cloak.race[raceId];
            if cloak.aId[slotId] == true then
                local cloakLv = cloak.getCloakLv(slot);
                AddState(role, role, state, cloakLv, 3600);
            else
                local hasCloak = GetChaStateLv(role, state);
                if hasCloak ~= 0 and slotId ~= cloak.conf['itemId'] then
                    --BickerNotice(role, 'asd');
                    RemoveState(role, state);
                end
				RefreshCha(role)
            end
       end
	end
 
    Skill_Melee_End = function(ATKER, DEFER, sklv)
        cloak.hook['melee'](ATKER, DEFER, sklv)
        cloak.skill(ATKER, DEFER, sklv)
    end
 
    Skill_Range_End = function(ATKER, DEFER, sklv)
        cloak.hook['range'](ATKER, DEFER, sklv)
        cloak.skill(ATKER, DEFER, sklv)
    end
 
    Skill_Xlcz_End = function(ATKER, DEFER, sklv)
        cloak.hook['bolt'](ATKER, DEFER, sklv)
        cloak.skill(ATKER, DEFER, sklv)
    end
 
   Skill_Bkcj_End = function(ATKER, DEFER, sklv)
        cloak.hook['conch'](ATKER, DEFER, sklv)
        cloak.skill(ATKER, DEFER, sklv)
    end 
 
    function ItemUse_CloakUpgrade(role, Item)
        local Cha_Boat = GetCtrlBoat ( role )
        if Cha_Boat ~=  nil then
            SystemNotice( role , "Cannot use while sailing" )
            UseItemFailed ( role )
            return
        end
        local slot = GetChaItem(role, 2, (cloak.conf['itemSlot'] - 1));
        local slotId = GetItemID(slot);
        local cloakLv = cloak.getCloakLv(slot);
        local deviceId = GetItemID(Item);
        if slotId ~= cloak.conf['itemId'] then
            BickerNotice(role, 'Cannot use ['..GetItemName(deviceId)..'] on '..GetItemName(slotId)..'!');
            UseItemFailed(role);
            return
        end
        local cloakLv = cloak.getCloakLv(slot);
        if cloakLv >= cloak.conf['maxLv'] then
            BickerNotice(role, '['..GetItemName(slotId)..'] already maxed Upgrade!');
            UseItemFailed(role);
            return
        end
        local successRate = Percentage_Random(cloak.upRate[cloakLv]);
        if successRate == 1 then
            BickerNotice(role, successRate);
            local startAttr,endAttr = ITEMATTR_VAL_STR,ITEMATTR_VAL_STA;
            local itemAttr = {};
            local increment = 1;
            for i = startAttr,endAttr do
                itemAttr[i] = GetItemAttr(slot, i);
                SetItemAttr(slot, i, itemAttr[i] + cloak.conf['statperLv']);
            end
            -- 183
            SetItemAttr(slot, 55, cloakLv + 1);
            SetItemAttr(slot, 183, cloakLv + 1);
            SynChaKitbag(role,13)
            PlayEffect(role, 345);
        else
            SystemNotice(role , "Sorry, upgrade has failed! Luckily Cloak is not damaged...");
            PlayEffect(role, 346);
        end
    end
 
    function ItemUse_CloakUnseal(role, Item)
        local Cha_Boat = GetCtrlBoat ( role )
        if Cha_Boat ~=  nil then
            SystemNotice( role , "Cannot use while sailing" )
            UseItemFailed ( role )
            return
        end
        local HasItem = CheckBagItem(role, cloak.conf['dustyId']);
        if HasItem < 1 then
            BickerNotice(role,"You need ["..GetItemName(cloak.conf['dustyId']).."] in your Inventory!");
            UseItemFailed(role);
            return
        else
            TakeItem(role, 0, cloak.conf['dustyId'], 1)
            GiveItem(role, 0, cloak.conf['itemId'], 1, 25);
            Notice(GetChaDefaultName(role)..' successfully Unsealed a '..GetItemName(cloak.conf['dustyId'])..'!');
            PlayEffect(role, 345)
            RefreshCha(role)
        end
    end
 
function State_CAPE_Add ( role , statelv )
    local strsb_dif = cloak.conf['statperLv'] * statelv
    local consb_dif = cloak.conf['statperLv'] * statelv
    local agisb_dif = cloak.conf['statperLv'] * statelv
    local dexsb_dif = cloak.conf['statperLv'] * statelv
    local stasb_dif = cloak.conf['statperLv'] * statelv
    local strsb = StrSb( role ) + strsb_dif
    SetCharaAttr( strsb , role , ATTR_STATEV_STR )
    local consb = ConSb( role ) + consb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_CON )
    local agisb = ConSb( role ) + agisb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_AGI )
    local dexsb = ConSb( role ) + dexsb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_DEX )
    local stasb = ConSb( role ) + stasb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_STA )
    ALLExAttrSet(role)	
end
 
function State_CAPE_Rem ( role , statelv )
    local strsb_dif = cloak.conf['statperLv'] * statelv
    local consb_dif = cloak.conf['statperLv'] * statelv
    local agisb_dif = cloak.conf['statperLv'] * statelv
    local dexsb_dif = cloak.conf['statperLv'] * statelv
    local stasb_dif = cloak.conf['statperLv'] * statelv
    local strsb = StrSb( role ) - strsb_dif
    SetCharaAttr( strsb , role , ATTR_STATEV_STR )
    local consb = ConSb( role ) - consb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_CON )
    local agisb = ConSb( role ) - agisb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_AGI )
    local dexsb = ConSb( role ) - dexsb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_DEX )
    local stasb = ConSb( role ) - stasb_dif
    SetCharaAttr( consb , role , ATTR_STATEV_STA )
    ALLExAttrSet(role)	
end

function STATE_Riven_Add(role, statelv)
    local pdef_dif = 5 * statelv
    local pdef = ResistSb(role) - pdef_dif
    SetCharaAttr( pdef , role , ATTR_STATEV_PDEF )	
    ALLExAttrSet(role)  
end
 
function STATE_Riven_Rem(role, statelv)
    local pdef_dif = 5 * statelv
    local pdef = ResistSb(role) + pdef_dif
    SetCharaAttr( pdef , role , ATTR_STATEV_PDEF )	
    ALLExAttrSet(role)  
end
 
function STATE_Pierc_Add(role, statelv)
    local defsb_dif = 50 * statelv
    local defsb = DefSb(role) - defsb_dif
    SetCharaAttr( defsb , role , ATTR_STATEV_DEF )
	ALLExAttrSet(role)
end
 
function STATE_Pierc_Rem(role, statelv)
    local defsb_dif = 50 * statelv
    local defsb = DefSb(role) + defsb_dif
    SetCharaAttr( defsb , role , ATTR_STATEV_DEF )
    ALLExAttrSet(role)
end
 
function STATE_Illusory_Add(role, statelv)
    local fleesb_dif = 10 * statelv
    local fleesb = FleeSb(role) - fleesb_dif
    SetCharaAttr( fleesb , role , ATTR_STATEV_FLEE )
    ALLExAttrSet(role)  
end
 
function STATE_Illusory_Rem(role, statelv)
    local fleesb_dif = 10 * statelv
    local fleesb = FleeSb(role) + fleesb_dif
    SetCharaAttr( fleesb , role , ATTR_STATEV_FLEE )
    ALLExAttrSet(role)  
end
 
function STATE_Curse_Add(role, statelv)
    local hitsb_dif = 10 * statelv
    local hitsb = HitSb(role) - hitsb_dif
    SetCharaAttr( hitsb , role , ATTR_STATEV_HIT )
    ALLExAttrSet(role)
end
 
function STATE_Curse_Rem(role, statelv)
    local hitsb_dif = 10 * statelv
    local hitsb = HitSb(role) + hitsb_dif
    SetCharaAttr( hitsb , role , ATTR_STATEV_HIT )
    ALLExAttrSet(role)
end


I tried just cape with clean files and normal pet system (no customs) and i still having problem when im using Poss i need to remove cape and put it again and use teleport to refresh stats, can someone help me fix this bug??

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0