Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- * ITEMINFO:
- 7148 Leeching Orb o0004 greenstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Leeching Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Take away the target's HP and transfers it to you.
- 7149 Static Orb o0003 yellowstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Static Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Decreases the Movement Speed of the target in 5 sec.
- 7150 Burning Orb o0002 redstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Burning Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Adds burning effect to the target, taking away 100 in 100 in 10 sec.
- 7151 Pushing Orb o0003 bluestone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Pushing Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Pushes the target in a certain distance, ranging the movement speed of the target.
- 7152 Focusing Orb o0001 bluestone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Focusing Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Take away the target's SP and transfers it to you.
- 7153 Poisonous Orb o0003 greenstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Poisonous Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Adds poison to the target, taking away 100 in 100 in 10 sec.
- 7154 Paralyzing Orb o0004 yellowstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Paralyzing Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Stun the target in 1 sec.
- 7155 Icing Orb o0003 yellowstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Icing Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: freezes the target in 3 sec.
- 7156 Breaking Orb o0002 yellowstone01 0 0 0 0 0 00 99 0 0 0 0 0 1 1 1 1 99 0 0 -1 0 -1 0 0 -1 -1 0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0,0 0 0,0 0,0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 Breaking Orb. An Orb created of many powerful mixtures to enchant your weapon. Effect: Decrease defence of target in 10 sec.
- * ITEMPRE:
- 21 Poisonous
- 22 Paralyzing
- 23 Leeching
- 24 Burning
- 25 Static
- 26 Pushing
- 27 Focusing
- 28 Icing
- 29 Breaking
- --]]
- -- Credits: Momo
- function is_Weapon(item)
- local Item_type = GetItemType(item)
- if Item_type ~= 0 then
- if Item_type == 1 or Item_type == 2 or Item_type == 3 or Item_type == 4 or Item_type == 7 or Item_type == 11 or Item_type == 9 then
- return 1
- end
- end
- return 0
- end
- function add_prefix(item,pre)
- local old = GetItemAttr(item, 53)
- SetItemAttr(item, 53, math.mod(old, 1000) * 1000 + pre * 10 + math.floor(old / 1000))
- end
- function get_prefix(item)
- local prefix = math.floor(math.mod(GetItemAttr(item, 53), 1000) / 10)
- return prefix
- end
- function prefix_bonus( ATKER , DEFER )
- local prefix_l = 0
- local prefix_r = 0
- local wepl = GetEquipItemP(ATKER,6)
- local wepr = GetEquipItemP(ATKER,9)
- local wepl_ID = GetItemID(wepl)
- local wepr_ID = GetItemID(wepr)
- if wepl_ID ~= 0 then
- prefix_l = get_prefix(wepl)
- end
- if wepr_ID ~= 0 then
- prefix_r = get_prefix(wepr)
- end
- if prefix_l == 24 or prefix_r == 24 then --- BURNING (dmg every second)
- local status = STATE_RS
- local Percentage = Percentage_Random ( 0.1 )
- if Percentage == 1 then
- AddState ( ATKER , DEFER , status , 1 , 10 )
- end
- elseif prefix_l == 21 or prefix_r == 21 then --- POISONING (dmg every second)
- local status = STATE_JSDD
- local Percentage = Percentage_Random ( 0.1 )
- if Percentage == 1 then
- AddState ( ATKER , DEFER , status , 1 , 10 )
- end
- elseif prefix_l == 25 or prefix_r == 25 then --- ELECTRYFING (Slow)
- local status = STATE_MB
- local Percentage = Percentage_Random ( 0.1 )
- if Percentage == 1 then
- AddState ( ATKER , DEFER , status , 10 , 5 )
- end
- elseif prefix_l == 22 or prefix_r == 22 then --- PARALYZING (Short Stun)
- local status = STATE_XY
- local Percentage = Percentage_Random ( 0.04 )
- if Percentage == 1 then
- AddState ( ATKER , DEFER , status , 1 , 1 )
- end
- elseif prefix_l == 27 or prefix_r == 27 then --- FOCUSING (takes target sp and recovers yours
- local t_lv = GetChaAttr ( DEFER , ATTR_LV )
- sp_resume = -100 * t_lv / math.random (10,20)
- sp_reduce = 100 * t_lv / math.random (10,20)
- local Percentage = Percentage_Random ( 0.06 )
- if Percentage == 1 then
- Sp_Red (DEFER , sp_reduce )
- Sp_Red ( ATKER , sp_resume )
- end
- elseif prefix_l == 23 or prefix_r == 23 then --- Leeching( takes target some hp and heals you)
- local t_lv = GetChaAttr ( DEFER , ATTR_LV )
- hp_resume = -100 * t_lv / math.random (10,20)
- local Percentage = Percentage_Random ( 0.04 )
- if Percentage == 1 then
- Hp_Endure_Dmg ( ATKER , hp_resume )
- end
- elseif prefix_l == 26 or prefix_r == 26 then --- PUSHING (Pushs the target away)
- local Percentage = Percentage_Random ( 0.1 )
- if Percentage == 1 then
- local t_lv = GetChaAttr ( DEFER , ATTR_LV )
- local distance = 100 * t_lv / math.random (15,30)
- BeatBack ( ATKER , DEFER , distance )
- end
- elseif prefix_l == 28 or prefix_r == 28 then --- Icing
- local status = STATE_BIW
- local Percentage = Percentage_Random ( 0.1 )
- if Percentage == 1 then
- AddState ( ATKER , DEFER , status , 1 , 3 )
- end
- elseif prefix_l == 29 or prefix_r == 29 then --- Breaking
- local status = STATE_PJ
- local Percentage = Percentage_Random ( 0.1 )
- if Percentage == 1 then
- AddState ( ATKER , DEFER , status , 5 , 10 )
- end
- end
- prefix_l = 0
- prefix_r = 0
- end
- -- NPC Functions
- function orb_enchant()
- Talk( 1, "Lizzy: Young man, I can enchant your equipment aslong you bring me one Orb." )
- for i = 1,4 do
- if ORBS[i].Opened ~= 0 then
- failurePage = ORBS_COUNT + i
- langPage = ORBS_COUNT + i + 1
- orbid = ORBS[i].ItemID
- InitTrigger()
- TriggerCondition( i, HasItem, orbid ,1 )
- TriggerCondition( i, EnchantCheck )
- TriggerAction( i, Enchant, orbid )
- TriggerFailure( i, JumpPage, failurePage )
- orbName = ORBS[i].Name
- failureText = "You do not have "..ORBS[i].Name.." . Come again when you have it. "
- if (ORBS[i].Cost > 0) then
- orbName = orbName.." cost "..ORBS[i].Cost.." gold "
- failureText = failureText.." It costs "..ORBS[i].Cost.." to enchant your weapon..."
- TriggerCondition( i, HasMoney, ORBS[i].Cost )
- TriggerAction( i, TakeMoney, ORBS[i].Cost )
- end
- Text( 1, orbName,MultiTrigger, GetMultiTrigger(), i )
- Talk( failurePage, failureText)
- end
- end
- InitTrigger()
- TriggerCondition( 6, ExtractCheck )
- TriggerAction( 6, ExtractOrb, 1 )
- Text( 1, "Remove/Erease Orb",MultiTrigger, GetMultiTrigger(), 6 )
- Text( 1, "Next Page",JumpPage, 2 )
- Talk( 2, "Lizzy: Young man, I can enchant your equipment aslong you bring me one Orb." )
- for i = 5,9 do
- if ORBS[i].Opened ~= 0 then
- failurePage = ORBS_COUNT + i
- langPage = ORBS_COUNT + i + 1
- orbid = ORBS[i].ItemID
- InitTrigger()
- TriggerCondition( i, HasItem, orbid ,1 )
- TriggerCondition( i, EnchantCheck )
- TriggerAction( i, Enchant, orbid )
- TriggerFailure( i, JumpPage, failurePage )
- orbName = ORBS[i].Name
- failureText = "You do not have "..ORBS[i].Name.." . Come again when you have it. "
- if (ORBS[i].Cost > 0) then
- orbName = orbName.." cost "..ORBS[i].Cost.." gold "
- failureText = failureText.." It costs "..ORBS[i].Cost.." to enchant your weapon..."
- TriggerCondition( i, HasMoney, ORBS[i].Cost )
- TriggerAction( i, TakeMoney, ORBS[i].Cost )
- end
- Text( 2, orbName,MultiTrigger, GetMultiTrigger(), i )
- Talk( failurePage, failureText)
- end
- end
- end
- function EnchantCheck(role)
- local NocLock = KitbagLock( role, 0 )
- if NocLock == LUA_FALSE then
- HelpInfo( role ,0,"Your inventory is locked.")
- return LUA_FALSE
- end
- local Item_bg = GetChaItem ( role , 2 , 3 )
- local Item_Type = GetItemType ( Item_bg )
- local ItemID = GetItemID ( Item_bg )
- if Item_Type == 1 or Item_Type == 2 or Item_Type == 3 or Item_Type == 4 or Item_Type == 7 or Item_Type == 9 then
- local prefix = math.floor(math.mod(GetItemAttr(Item_bg, 53), 1000) / 10)
- if GetItemAttr(Item_bg, 53) < 9001 and GetItemAttr(Item_bg, 53) ~= 9300 then
- return LUA_TRUE
- else
- return LUA_TRUE
- end
- else
- HelpInfo( role ,0, "You must put a Weapon on your 4th Inventory Slot." )
- return LUA_FALSE
- end
- end
- function Enchant(role, value)
- local NocLock = KitbagLock( role, 0 )
- if NocLock == LUA_FALSE then
- HelpInfo( role ,0, "Your inventory is locked.")
- return LUA_FALSE
- end
- local prefix = 0
- local Item_bg = GetChaItem ( role , 2 , 3 )
- local Item_Type = GetItemType ( Item_bg )
- local ItemID = GetItemID ( Item_bg )
- local orb_id = value
- local Orb_Num = CheckBagItem( role , orb_id )
- if Orb_Num >= 0 and Item_Type == 1 or Item_Type == 2 or Item_Type == 3 or Item_Type == 4 or Item_Type == 7 or Item_Type == 9 then
- for i = 1,ORBS_COUNT do
- if orb_id == ORBS[i].ItemID then
- prefix = ORBS[i].Pre
- end
- end
- local now_prefix = math.floor(math.mod(GetItemAttr(Item_bg, 53), 1000) / 10)
- local old = GetItemAttr(Item_bg, 53)
- if Item_Type == 1 or Item_Type == 2 or Item_Type == 3 or Item_Type == 4 or Item_Type == 7 or Item_Type == 9 then
- if GetItemAttr(Item_bg, 53) < 9001 then
- local rad = math.random ( 1, 100 )
- if rad<=70 then
- TakeItem( role, 0,orb_id, 1 )
- SetItemAttr(Item_bg, 53, 9000 + prefix * 10)
- HelpInfo( role ,0,"Successful enchanted your Weapon.")
- return LUA_TRUE
- elseif rad <= 30 then
- TakeItem( role, 0,orb_id, 1 )
- SetItemAttr(Item_bg, 53, 9300)
- HelpInfo( role ,0,"You failed enchanting the weapon! This Weapon can not be enchanted anymore!")
- return LUA_TRUE
- else
- TakeItem( role, 0,orb_id, 1 )
- HelpInfo( role ,0,"You failed enchanting the Weapon!")
- return LUA_FALSE
- end
- else
- local rad = math.random ( 1, 100 )
- if rad<=60 then
- TakeItem( role, 0,orb_id, 1 )
- SetItemAttr(Item_bg, 53, 9000 + prefix * 10)
- HelpInfo( role ,0,"Successful enchanted your Weapon.")
- return LUA_TRUE
- elseif rad <= 10 then
- TakeItem( role, 0,orb_id, 1 )
- SetItemAttr(Item_bg, 53, 9300)
- HelpInfo( role ,0,"You failed enchanting the equipment! This Equipment can not be enchanted anymore!")
- return LUA_TRUE
- else
- TakeItem( role, 0,orb_id, 1 )
- HelpInfo( role ,0,"You failed enchanting the equipment!")
- return LUA_FALSE
- end
- end
- else
- HelpInfo( role ,0,"Weapon and Orb Type do not Match!")
- return LUA_FALSE
- end
- else
- HelpInfo( role ,0,"You must put a Weapon on your 4th Inventory Slot." )
- return LUA_FALSE
- end
- end
- function ExtractOrb(role, value)
- local NocLock = KitbagLock( role, 0 )
- if NocLock == LUA_FALSE then
- HelpInfo( role ,0,"Your inventory is locked.")
- return LUA_FALSE
- end
- local prefix = 0
- local Item_bg = GetChaItem ( role , 2 , 3 )
- local Item_Type = GetItemType ( Item_bg )
- local ItemID = GetItemID ( Item_bg )
- if Item_Type == 1 or Item_Type == 2 or Item_Type == 3 or Item_Type == 4 or Item_Type == 7 or Item_Type == 9 then
- local now_prefix = math.floor(math.mod(GetItemAttr(Item_bg, 53), 1000) / 10)
- local old = GetItemAttr(Item_bg, 53)
- if GetItemAttr(Item_bg, 53) > 9000 then
- local rad = math.random ( 1, 100 )
- if rad <= 70 then
- SetItemAttr(Item_bg, 53, 9000)
- HelpInfo( role ,0,"Successful extracted your Orb.")
- local Item_CanGet = GetChaFreeBagGridNum(role)
- for i = 1,ORBS_COUNT do
- if now_prefix == ORBS[i].Pre then
- orb_id = ORBS[i].ItemID
- end
- end
- if Item_CanGet <= 0 then
- GiveItemX ( role , 0 , orb_id , 1 , 4 )
- else
- GiveItem ( role , 0 , orb_id , 1 , 4 )
- end
- return LUA_TRUE
- else
- SetItemAttr(Item_bg, 53, 9000)
- HelpInfo( role ,0,"You failed extracting your Orb!")
- return LUA_FALSE
- end
- else
- HelpInfo( role ,0,"You have no Orb in the Weapon.")
- return LUA_FALSE
- end
- else
- HelpInfo( role ,0,"You must put a weapon on your 4th Inventory Slot." )
- return LUA_FALSE
- end
- end
- function ExtractCheck(role)
- local NocLock = KitbagLock( role, 0 )
- if NocLock == LUA_FALSE then
- HelpInfo( role ,0,"Your inventory is locked.")
- return LUA_FALSE
- end
- local Item_bg = GetChaItem ( role , 2 , 3 )
- local Item_Type = GetItemType ( Item_bg )
- local ItemID = GetItemID ( Item_bg )
- if Item_Type == 1 or Item_Type == 2 or Item_Type == 3 or Item_Type == 4 or Item_Type == 7 or Item_Type == 9 then
- local prefix = math.floor(math.mod(GetItemAttr(Item_bg, 53), 1000) / 10)
- if GetItemAttr(Item_bg, 53) > 9000 and GetItemAttr(Item_bg, 53) ~= 9300 then
- return LUA_TRUE
- else
- HelpInfo( role ,0,"This weapon has no Orb!")
- return LUA_FALSE
- end
- else
- HelpInfo( role ,0,"You must put a weapon on your 4th Inventory Slot." )
- return LUA_FALSE
- end
- end
- ORBS_COUNT = 9 -- Number of Total Enchantments
- ORBS =
- {
- { Name="Icing Orb", Opened=1, Cost=500000, Pre=28, ItemID=7155 },
- { Name="Static Orb", Opened=1, Cost=500000, Pre=25, ItemID=7149 },
- { Name="Burning Orb", Opened=1, Cost=500000, Pre=24, ItemID=7150 },
- { Name="Pushing Orb", Opened=1, Cost=500000, Pre=26, ItemID=7151 },
- { Name="Leeching Orb", Opened=1, Cost=500000, Pre=23, ItemID=7148 },
- { Name="Breaking Orb", Opened=1, Cost=500000, Pre=29, ItemID=7156 },
- { Name="Focusing Orb", Opened=1, Cost=500000, Pre=27, ItemID=7152 },
- { Name="Poisonous Orb", Opened=1, Cost=500000, Pre=21, ItemID=7153 },
- { Name="Paralyzing Orb", Opened=1, Cost=500000, Pre=22, ItemID=7154 }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement