Advertisement
Laboe

Demonic Helm.lua

Dec 13th, 2016
540
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 8.02 KB | None | 0 0
  1. ------------------------------------------------------
  2. -- Nightmare Demonic Helm System by: Laboe          --
  3. -- Credits for Xtacy Clock system.                  --
  4. ------------------------------------------------------
  5.  
  6. --[[ Iteminfo.txt:
  7. 3751    Nightmare Demonic Helm  e1043   10110001    0000920001  0001930001  0002991001  0003010301  0   0   20  0   0   0   0   0   1   1   1   1   1   1   0   -1  80  -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2   0   0   0,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2   0   0   0   0   0   0   0   0   0   0   0   0   20  20  0   0   0   0   0   0   20  0   0   0   0   0   0   0   0   0   0   0   0   20  20  0   0   0   0   0   0   0   0   0,30    0   0   20000,2 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   Nightmare Demonic equipments    0
  8. 7803    Nightmare Demonic Helm Pump n2559   10130005    0   0   0   0   0   0   87  0   0   0   0   0   1   1   1   1   99  0   0   -1  0   -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2   0   0   -1,-2,-2,-2,-2,-2,-2,-2,-2,-2   -1,-2,-2,-2,-2,-2,-2,-2,-2,-2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   ItemUse_HelmPump    0   0   0   0   0   0   Pumps the Nightmare Demonic Helm to Level it up [Level 1-10]! Double click the item, then click on the selected Nightmare Demonic Helm to start leveling (Possible failure)!    0
  9. 7812    Dusty Nightmare Demonic Helm    e1043   10110001    0000920001  0001930001  0002991001  0003010301  0   0   20  0   0   0   0   0   1   1   1   1   1   1   0   -1  80  -1,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2,-2   0   0   0,-2,-2,-2,-2,-2,-2,-2,-2,-2    -1,-2,-2,-2,-2,-2,-2,-2,-2,-2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0,10000 0,10000 0   0   0   0   0   0   0,100   0   0,10    0   0   20000,2 0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   Nightmare Demonic equipments    0
  10.  
  11.  
  12. --skilleff.txt
  13. 209 sergeant1   -1  0   SERGEANT1_Add   SERGEANT1_Rem   1   0   1   1   1   1   1   1   1   1   1   1   1   1   0   0   0   -1  0   0   0   4112    1   0   0   0   0   0   0   0
  14. 210 sergeant2   -1  0   SERGEANT2_Add   SERGEANT2_Rem   1   0   1   1   1   1   1   1   1   1   1   1   1   1   0   0   0   -1  0   0   0   4113    1   0   0   0   0   0   0   0
  15. 213 sergeant3   -1  0   SERGEANT3_Add   SERGEANT3_Rem   1   0   1   1   1   1   1   1   1   1   1   1   1   1   0   0   0   -1  0   0   0   4114    1   0   0   0   0   0   0   0
  16. 230 sergeant4   -1  0   SERGEANT4_Add   SERGEANT4_Rem   1   0   1   1   1   1   1   1   1   1   1   1   1   1   0   0   0   -1  0   0   0   4115    1   0   0   0   0   0   0   0
  17. 239 sergeant5   -1  0   SERGEANT5_Add   SERGEANT5_Rem   1   0   1   1   1   1   1   1   1   1   1   1   1   1   0   0   0   -1  0   0   0   4116    1   0   0   0   0   0   0   0
  18.  
  19. --sceneeffectinfo.txt
  20. 4112    laboem1.par VIPÏîÁ´ º£ÀË    1   0   -1,-1,-1,-1,-1,-1,-1,-1 -1  3   0.0 0.0 -1.0
  21. 4113    laboem2.par VIPÏîÁ´ º£ÀË    1   0   -1,-1,-1,-1,-1,-1,-1,-1 -1  3   0.0 0.0 -1.0
  22. 4114    laboem3.par VIPÏîÁ´ º£ÀË    1   0   -1,-1,-1,-1,-1,-1,-1,-1 -1  3   0.0 0.0 -1.0
  23. 4115    laboem4.par VIPÏîÁ´ º£ÀË    1   0   -1,-1,-1,-1,-1,-1,-1,-1 -1  3   0.0 0.0 -1.0
  24. 4116    laboem5.par VIPÏîÁ´ º£ÀË    1   0   -1,-1,-1,-1,-1,-1,-1,-1 -1  3   0.0 0.0 -1.0
  25.  
  26. ----function Creat_Item_Tattr(item_type,item_lv , item_event) ----
  27.     if item_event == 25 then
  28.        
  29.         Add_Item_Attr( ITEMATTR_VAL_MXHP, 0);
  30.         Add_Item_Attr( ITEMATTR_VAL_MXSP, 0);
  31.         Add_Item_Attr( ITEMATTR_VAL_PDEF, 0);
  32.         Add_Item_Attr( ITEMATTR_VAL_MSPD, 0);
  33.         Add_Item_Attr( ITEMATTR_COE_MXSP , 0);
  34.  
  35.        
  36.     end
  37.    
  38. ----function Creat_Item(item, item_type, item_lv, item_event)----
  39.     if item_event == 25 then
  40.         Add_Item_Attr( ITEMATTR_VAL_MXHP, 0);
  41.         Add_Item_Attr( ITEMATTR_VAL_MXSP, 0);
  42.         Add_Item_Attr( ITEMATTR_VAL_PDEF, 0);
  43.         Add_Item_Attr( ITEMATTR_VAL_MSPD, 0);
  44.         Add_Item_Attr( ITEMATTR_COE_MXSP , 0);
  45.         Add_Item_Attr( ITEMATTR_COE_MXHP , 0);
  46.  
  47.     end
  48.    
  49. ---in cha_timer
  50. Helm_Timer (role, freq, time)
  51. ]]
  52.  
  53.  helm = {};
  54.     helm.conf           = {
  55.         itemId          = 3751,
  56.         dustyId         = 7812,
  57.         pump            = 7803,
  58.         maxLv           = 10,
  59.         More_HP         = 1000,
  60.         More_SP         = 1000,
  61.         More_PR         = 1,
  62.         Move_speed      = 10,
  63.         Slot            = 0
  64.     };
  65.    
  66.    
  67.     helm.effect             = {};
  68.         helm.effect[1]      = 209
  69.         helm.effect[2]      = 209
  70.         helm.effect[3]      = 209
  71.         helm.effect[4]      = 210
  72.         helm.effect[5]      = 210
  73.         helm.effect[6]      = 213
  74.         helm.effect[7]      = 213
  75.         helm.effect[8]      = 230
  76.         helm.effect[9]      = 230
  77.         helm.effect[10]     = 239
  78.  
  79.    
  80.     helm.aId        = {
  81.         [helm.conf['itemId']] = true
  82.     };
  83.  
  84.     helm.upRate                 = {};
  85.         helm.upRate[0]          = 1
  86.         helm.upRate[1]          = .9
  87.         helm.upRate[2]          = .8
  88.         helm.upRate[3]          = .7
  89.         helm.upRate[4]          = .6
  90.         helm.upRate[5]          = .5
  91.         helm.upRate[6]          = .4
  92.         helm.upRate[7]          = .3
  93.         helm.upRate[8]          = .2
  94.         helm.upRate[9]          = .1
  95.  
  96.    
  97.        
  98. function helm_getHelmLv(item)
  99.     local getLv = GetItemAttr(item, 55);
  100.     if(getLv ~= nil) then
  101.         return getLv;
  102.     elseif(IsPlayer(role) == 1) then
  103.         if getLv > 0 then
  104.             return getLv;
  105.         end
  106.         return 0;
  107.     end
  108. end
  109.  
  110.    
  111.    
  112.    
  113.    
  114. function helm_hasHelm(cha)
  115.     local head = GetChaItem(cha, 1, (helm.conf['Slot']));
  116.     local headId = GetItemID(head);
  117.  
  118.     if headId == helm.conf['itemId'] then
  119.         return 1;
  120.     end
  121.     return 0;
  122. end
  123.    
  124. function Helm_Timer (role, freq, time)
  125.     if IsPlayer(role) == 1 then
  126.         local head = GetChaItem(role, 1, (helm.conf['Slot']));
  127.         local headId = GetItemID(head);
  128.         local helmon = helm.aId[headId];
  129.         local helmLv = helm_getHelmLv(head);
  130.        
  131.         if (helmon == true) then
  132.             local statehelm = helm.effect[helmLv];
  133.             AddState(role, role, statehelm, helmLv, 3600);
  134.         else
  135.             local hasHelm = GetChaStateLv(role, statehelm);
  136.             if hasHelm ~= 0 or headId ~= helm.conf['itemId'] then
  137.            
  138.                 for helmLvi = 1,10 ,1 do
  139.                     local statehelm = helm.effect[helmLvi];
  140.                     RemoveState(role, statehelm);
  141.                 end
  142.             end
  143.         end
  144.  
  145.     end
  146. end
  147.  
  148. function ItemUse_HelmPump(role, Item)
  149.     local Cha_Boat = GetCtrlBoat ( role )
  150.     if Cha_Boat ~=  nil then
  151.         SystemNotice( role , "Cannot use while sailing" )
  152.         UseItemFailed ( role )
  153.         return
  154.     end
  155.     local head = GetChaItem(role, 1, (helm.conf['Slot']));
  156.     local headId = GetItemID(head);
  157.     local helmLv = helm_getHelmLv(head);
  158.     local deviceId = GetItemID(Item);
  159.     if headId ~= helm.conf['itemId'] then
  160.         BickerNotice(role, 'Cannot use ['..GetItemName(deviceId)..'] on '..GetItemName(headId)..'!');
  161.         UseItemFailed(role);
  162.         PlayEffect(role, 346);
  163.         return
  164.     end
  165.  
  166.     local helmLv = helm_getHelmLv(head);
  167.     if helmLv >= helm.conf['maxLv'] then
  168.         BickerNotice(role, '['..GetItemName(headId)..'] already maxed Upgrade!');
  169.         UseItemFailed(role);
  170.         return
  171.     end
  172.    
  173.         local success_Rate = Percentage_Random(helm.upRate[helmLv]);
  174.         local helmLv = helm_getHelmLv(head);
  175.         if success_Rate == 1 then
  176.            
  177.             local helmattr = helmLv + 1
  178.  
  179.            
  180.             PlayEffect(role, 345);
  181.             SetItemAttr(head, ITEMATTR_VAL_MXHP, (helmattr * helm.conf['More_HP']));
  182.             SetItemAttr(head, ITEMATTR_VAL_MXSP, (helmattr * helm.conf['More_SP']));
  183.             SetItemAttr(head, ITEMATTR_VAL_PDEF, (helmattr * helm.conf['More_PR']));
  184.             SetItemAttr(head, ITEMATTR_VAL_MSPD, (helmattr * helm.conf['Move_speed']));
  185.             SetItemAttr(head, 55, helmLv + 1);
  186.            
  187.             local helmLv = helm_getHelmLv(head);
  188.             if helmLv == 10 then
  189.                  GMNotice (GetChaDefaultName(role).." Upgraded Domonic Helm to Lv10 Enjoy!")
  190.                  
  191.             end
  192.  
  193.         else
  194.             SystemNotice(role , "Sorry, upgrade has failed! Luckily helm is not damaged...");
  195.             PlayEffect(role, 346);
  196.    
  197.     end
  198. end
  199.  
  200. function ItemUse_HelmUnseal(role, Item)
  201.     local Cha_Boat = GetCtrlBoat ( role )
  202.     if Cha_Boat ~=  nil then
  203.         SystemNotice( role , "Cannot use while sailing" )
  204.         UseItemFailed ( role )
  205.         return
  206.     end
  207.     local HasItem = CheckBagItem(role, helm.conf['dustyId']);
  208.     if HasItem < 1 then
  209.         BickerNotice(role,"You need ["..GetItemName(helm.conf['dustyId']).."] in your Inventory!");
  210.         UseItemFailed(role);
  211.         return
  212.     else
  213.         TakeItem(role, 0, helm.conf['dustyId'], 1)
  214.         GiveItem(role, 0, helm.conf['itemId'], 1, 25);
  215.         GiveItem(role, 0, helm.conf['pump'], 1, 4)
  216.         Notice(GetChaDefaultName(role)..' successfully Unsealed a '..GetItemName(helm.conf['dustyId'])..'!');
  217.         PlayEffect(role, 345)
  218.         RefreshCha(role)
  219.     end
  220. end
  221.    
  222.  
  223.  
  224. function SERGEANT1_Add ( role , statelv )
  225. end
  226. function SERGEANT1_Rem ( role , statelv )
  227. end
  228.  
  229.  
  230. function SERGEANT2_Add ( role , statelv )
  231. end
  232. function SERGEANT2_Rem ( role , statelv )
  233. end
  234.  
  235.  
  236. function SERGEANT3_Add ( role , statelv )
  237. end
  238. function SERGEANT3_Rem ( role , statelv )
  239. end
  240.  
  241.  
  242. function SERGEANT4_Add ( role , statelv )
  243. end
  244. function SERGEANT4_Rem ( role , statelv )
  245. end
  246.  
  247.  
  248. function SERGEANT5_Add ( role , statelv )
  249. end
  250. function SERGEANT5_Rem ( role , statelv )
  251. end
  252.  
  253.  
  254.  
  255. print( "Demonic Helm.lua Loading Done!" )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement