• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Map init

Level 17
Joined
Nov 13, 2006
Messages
1,814
JASS:
//-----------------------------------------------------------
//      Item / Heroes registration
//-----------------------------------------------------------

function RegItemCat4Shop takes integer c, integer id returns nothing
    local integer i = LoadInteger(udg_Shop_Table, c, 0)
    local integer a = LoadInteger(udg_Shop_Table, 0, 0)
    if a < 1000 then
        set a = 1000
    endif
    set a = a + 1
    set i = i + 1
    call SaveInteger(udg_Shop_Table, c, 0, i)
    call SaveInteger(udg_Shop_Table, 0, 0, a)
    call SaveInteger(udg_Shop_Table, c, i, id)
    call SaveInteger(udg_Shop_Table, c, - i, a)
endfunction

function RegItem4Shop takes integer c, integer sc, integer itd, integer unique returns nothing
    local integer id = LoadInteger(udg_Shop_Table, c, - sc)
    local integer i = LoadInteger(udg_Shop_Table, id, 0) + 1
    call SaveInteger(udg_Shop_Table, id, 0, i)
    call SaveInteger(udg_Shop_Table, id, i, itd)
    call SaveInteger(udg_Shop_Table, id, - i, unique)
endfunction

function RegisterItem takes integer id, integer dest, string path, integer price, integer lv, string descr, integer subtype returns nothing
    if path != null then
        call SaveStr(udg_FSS, 601, id, path)
    endif
    if descr != null then
        call SaveStr(udg_FSS, 604, id, descr)
    endif
    call SaveInteger(udg_FSS, 600, id, dest)
    call SaveInteger(udg_FSS, 602, id, price)
    call SaveInteger(udg_FSS, 603, id, lv)
    if subtype > 0 then
        call SaveInteger(udg_FSS, 605, id, subtype)
    endif
endfunction

function RegCraft takes integer id, integer d1, integer c1, integer d2, integer c2, integer d3, integer c3 returns nothing
    call SaveInteger(udg_FSS, 606, id, d1)
    call SaveInteger(udg_FSS, 607, id, c1)
    call SaveInteger(udg_FSS, 608, id, d2)
    call SaveInteger(udg_FSS, 609, id, c2)
    call SaveInteger(udg_FSS, 610, id, d3)
    call SaveInteger(udg_FSS, 611, id, c3)
endfunction

function AddDescription takes integer id, string s1, string s2, string s3 returns nothing
    call SaveStr(udg_FSS, 647, id, s1)
    call SaveStr(udg_FSS, 648, id, s2)
    call SaveStr(udg_FSS, 649, id, s3)
endfunction

function RegHeroes takes integer id1, integer id2, boolean Attachment, real size, integer class, integer damage, string mpath returns nothing
    call SaveInteger(udg_FSS, 630, id1, id2)
    call SaveInteger(udg_FSS, 630, id2, id1)
    call SaveBoolean(udg_FSS, 631, id2, Attachment)
    call SaveBoolean(udg_FSS, 631, id1, Attachment)
    call SaveReal(udg_FSS, 632, id1, size)
    call SaveInteger(udg_FSS, 633, id1, class)
    call SaveInteger(udg_FSS, 634, id1, damage)
    if mpath != null then 
        call SaveStr(udg_FSS, 635, id1, mpath)
    endif
endfunction

//-----------------------------------------------------------
//        Registering the stuffs
//-----------------------------------------------------------


function Trig_map_init_Actions takes nothing returns nothing
    local integer i = 1
    call RegHeroes (HERO_MELEE(), HERO_RANGED(), true, 1, 0, 2, null)
    call RegHeroes ('Hpal', 'Hpal', false, 1.5, 1, 2, "units\\human\\HeroPaladin\\HeroPaladin.mdx")
    call RegHeroes ('Hvwd', 'Hvwd', false, 1.7, 3, 3, "units\\creeps\\SylvanusWindrunner\\SylvanusWindrunner.mdx")
    //call SetUnitDrop ('hpea', 225, 420, 5000, 335) set drop rate to unit type
    // 2x25% for assigned drop, 4x20% for level drop, 3x35% for shared drop (in this example shared drop category is the 5000)
    //call AddUnitDrop ('hpea', 'pman', 14)// assign specific item drop to a unit type, peasant have 14% chance for drop mana potion
    //every 20 level we can set different drop 
    call AddLevelDrop(1, 'I001', 5.7)
    call AddLevelDrop(1, 'I002', 0.31)
    call AddLevelDrop(2, 'I002', 5.7)
    call AddLevelDrop(2, 'I003', 0.31)
    call AddLevelDrop(3, 'I003', 5.7)
    call AddLevelDrop(3, 'I004', 0.31)
    call AddLevelDrop(4, 'I004', 5.7)
    call AddLevelDrop(4, 'I005', 0.31)
    call AddLevelDrop(5, 'I005', 5.7)
    call AddLevelDrop(5, 'I006', 0.31)
    call AddLevelDrop(6, 'I006', 50)
    call SetUnitDrop ('nmrl', 0, 430, 5000, 0)
    call SetUnitDrop ('nogr', 0, 370, 5000, 0)
    //5000 cat = shared drop for every creep type
    call AddLevelDrop(5000, 'I00M', 2) //leather
    call AddLevelDrop(5000, 'I00O', 0.1) //feather
    call AddLevelDrop(5000, 'I00P', 0.1) //tome page
    call AddLevelDrop(5000, 'phea', 70.2) //hp pot
    call AddLevelDrop(5000, 'pman', 70.2) //mp pot
    call AddLevelDrop(5000, 'I000', 0.1) //refine stone

    // shared drop for every boss
    call AddLevelDrop(5001, 'I00M', 1.9) //leather
    call AddLevelDrop(5001, 'I00O', 23) //feather
    call AddLevelDrop(5001, 'I00P', 23) //tome page
    call AddLevelDrop(5001, 'I000', 25) //refine stone
    call AddLevelDrop(5001, 'phea', 1.2) //hp pot
    call AddLevelDrop(5001, 'pman', 1.2) //mp pot
    call AddDescription ('phea', "Glu... glu...", "Restore 250 hit point.", null)
    call AddDescription ('pman', "A tasty magic bottle", "Restore 150 mana point.", null)
    call AddDescription ('I000', "Feel the power!", "Tweak the equipments.", null)
    call AddDescription ('I001', "Weapon:  1 Attack lv", "Armor:  25 HP", "Wings:  2 HP/sec")
    call AddDescription ('I002', "Weapon:  2 Attack lv", "Armor:  50 HP", "Wings:  4 HP/sec")
    call AddDescription ('I003', "Weapon:  3 Attack lv", "Armor:  75 HP", "Wings:  6 HP/sec")
    call AddDescription ('I004', "Weapon:  4 Attack lv", "Armor:  100 HP", "Wings:  8 HP/sec")
    call AddDescription ('I005', "Weapon:  5 Attack lv", "Armor:  125 HP", "Wings:  10 HP/sec")
    call AddDescription ('I006', "Weapon:  7 Attack lv", "Armor:  175 HP", "Wings:  15 HP/sec")
    call AddDescription ('I00A', "Wonderfull herbs..", "Used for potions", null)
    call AddDescription ('I00B', "Secret of the nature", "Used for potions", null)
    call AddDescription ('I00C', "Amazing plants", "Used for potions", null)
    call AddDescription ('I00D', "Healer leafs", "Used for potions", null)
    call AddDescription ('I00E', "From inside", "Used for potions", null)
    call AddDescription ('I00F', "The green peace", "Used for potions", null)
    call AddDescription ('I00G', "Strong like metal", "Used for equipments", null)
    call AddDescription ('I00H', "Chop - chop", "Used for equipments", null)
    call AddDescription ('I00I', "Just the rain", "Used for potions", null)
    call AddDescription ('I00J', "Don't thrown away", "Used for potions", null)
    call AddDescription ('I00K', "Ethernal sunshine", "Used for potions", null)
    call AddDescription ('I00L', "Don't step to me", "Used for potions", null)
    call AddDescription ('I00M', "Soft like the silk", "Used for armors", null)
    call AddDescription ('I00N', "Feel the wind", "Used for potions", null)
    call AddDescription ('I00O', "Where is my feather?", "Used for Wings", null)
    call AddDescription ('I00P', "The Ancient script", "Used for Tomes.", null)
    call AddDescription ('I007', "Somebody in, copper mine?", "Used for Shield", null)
    call AddDescription ('I008', "Deep sea blue", "Used for Rainbow Stone", null)
    call AddDescription ('I009', "Shiny lil' red jewel", "Used for Rainbow Stone", null)
    call AddDescription ('I00Q', "Green like the grass", "Used for Rainbow Stone", null)
    call AddDescription ('I00R', "Masterpiece", "Used for Jewels", null)
    call AddDescription ('I00U', "Bag: Used for store items", "Storage capacity 24 item.", "Double click for open")
    call AddDescription ('mcou', "It is a lottery box", "Could contain equipment,", "potion, gold or nothing!")

//few not about drop system
//call SetUnitDrop (unit type, default drop chance, shared drop chance, shared drop id, level drop chance)
//call AddUnitDrop (unit type, item type id, drop chance)
//call RemoveItemDropFromUnit (unit type, item type id)
//call AddLevelDrop (level (this will be * 20), item type id, chance)

    call RegisterItem('ckng', 'B00H', "Helm1.mdx", 11, 101, "Helmet", 0)
    call RegisterItem('rin1', 'B00K', "Armor1.mdx", 13, 102, "Armor", 0)
    call RegisterItem('rag1', 'B00L', "Boot1.mdx", 10, 104, "Boot", 0)
    call RegisterItem('sbch', 'B00P', "Shield1.mdx", 15, 105, "Shield", 0)
    call RegisterItem('ccmd', 'B00N', "Wing1.mdx", 99999, 109, "Wing", 0)
    call RegisterItem('rlif', 'B00J', null, 9, 106, "Ring", 0)
    call RegisterItem('spsh', 'B00M', null, 12, 108, "Amulet", 0)
    call RegisterItem('rat9', 'B00Q', "Sword1.mdx", 20, 103, "Short Sword", 1)
    call RegisterItem('rde3', 'B016', "Mace.mdx", 20, 103, "Mace", 2)
    call RegisterItem('rde1', 'B015', "Hammer.mdx", 20, 103, "Hammer", 3)
    call RegisterItem('evtl', 'B014', "Quarterstaff.mdx", 20, 103, "Polearm", 4)
    call RegisterItem('ajen', 'B013', "Longsword.mdx", 20, 103, "Long sword", 5)
    call RegisterItem('lgdh', 'B00R', "Bow1.mdx", 20, 103, "Bow", 6)
    call RegisterItem('desc', 'B00D', "Dagger1.mdx", 20, 103, "Dagger", 7)
    call RegisterItem('ward', 'B011', "Wand.mdx", 20, 103, "Wand", 8)
    call RegisterItem('brac', 'B012', "Staff.mdx", 20, 103, "Staff", 9)
    call RegisterItem('hval', 'B00O', null, 50000, 110, "Tome", 0)
    call RegisterItem('cnob', 'B01S', null, 500, 111, "Charm", 0)
    call RegisterItem('I001', 'B00F', null, 100, 1500, "Materia", 0)
    call RegisterItem('I002', 'B00F', null, 300, 1501, null, 0)
    call RegisterItem('I003', 'B00F', null, 900, 1502, null, 0)
    call RegisterItem('I004', 'B00F', null, 1200, 1503, null, 0)
    call RegisterItem('I005', 'B00F', null, 3600, 1504, null, 0)
    call RegisterItem('I006', 'B00F', null, 10800, 1505, null, 0)
    call RegisterItem('I000', 'B00I', null, 1000, 1506, "Refine stone", 0)
    call RegisterItem('phea', 'B00S', null, 50, 1900, "HP Potion", 0)
    call RegisterItem('pman', 'B00T', null, 50, 1901, "Mana Potion", 0)
    call RegisterItem('pghe', 'B01T', null, 100, 1902, "Super HP Potion", 0)
    call RegisterItem('pgma', 'B01Y', null, 100, 1903, "Super MP Potion", 0)
    call RegisterItem('I00S', 'B01Z', null, 2200, 1904, "Scrolls", 0) // scroll of healing
    call RegisterItem('I00T', 'B020', null, 2200, 1905, null, 0) //scroll of mana

    call RegisterItem('I00U', 'B021', null, 900, BAG_LEVEL(), null, 0) //bag
    call RegisterItem('mcou', 'B022', null, 1000, BOX_LEVEL(), "Bag & Box", 0) //surprise box

// craft materia + herbs
    call RegisterItem('I00A', 'B01O', null, 10, 1200, null, 0)
    call RegisterItem('I00B', 'B01B', null, 10, 1200, null, 0)
    call RegisterItem('I00C', 'B01C', null, 10, 1200, null, 0)
    call RegisterItem('I00D', 'B01L', null, 10, 1200, null, 0)
    call RegisterItem('I00E', 'B01D', null, 10, 1200, null, 0)
    call RegisterItem('I00F', 'B01N', null, 10, 1200, null, 0)
    call RegisterItem('I00G', 'B01E', null, 10, 1200, null, 0) //iron
    call RegisterItem('I00H', 'B01J', null, 10, 1200, null, 0) //lumber
    call RegisterItem('I00I', 'B01F', null, 10, 1200, null, 0)
    call RegisterItem('I00J', 'B01M', null, 10, 1200, "Materia", 0) //stone
    call RegisterItem('I00K', 'B01I', null, 10, 1200, null, 0)
    call RegisterItem('I00L', 'B01G', null, 10, 1200, null, 0)
    call RegisterItem('I00M', 'B01A', null, 10, 1200, null, 0) //leather
    call RegisterItem('I00N', 'B01H', null, 10, 1200, null, 0)
    call RegisterItem('I00O', 'B01K', null, 100, 1200, null, 0) //feather
    call RegisterItem('I00P', 'B01P', null, 100, 1200, null, 0) //tome page

    call RegisterItem('I007', 'B01R', null, 100, 1201, null, 0) //copper ore
    call RegisterItem('I008', 'B01U', null, 100, 1201, null, 0) //ametyst
    call RegisterItem('I009', 'B01X', null, 100, 1201, null, 0) //ruby
    call RegisterItem('I00Q', 'B01W', null, 100, 1201, null, 0) //emerald
    call RegisterItem('I00R', 'B01V', null, 10000, 1200, null, 0) //Rainbow stone

    call RegisterItem('gold', 'B01Q', null, 1, 0, null, 0) //gold

  //shop settings
  //we set the shop, this way: key1: main category, key2: order, saved value the itemtypeid
    call RegItemCat4Shop (1, 'ckng')
    call RegItemCat4Shop (1, 'ckng')
    call RegItemCat4Shop (1, 'ckng')
    call RegItemCat4Shop (1, 'rin1')
    call RegItemCat4Shop (1, 'rin1')
    call RegItemCat4Shop (1, 'rin1')
    call RegItemCat4Shop (1, 'rag1')
    call RegItemCat4Shop (1, 'rag1')
    call RegItemCat4Shop (1, 'rag1')
    call RegItemCat4Shop (1, 'sbch')

    call RegItemCat4Shop (2, 'rat9')
    call RegItemCat4Shop (2, 'rde3')
    call RegItemCat4Shop (2, 'rde1')
    call RegItemCat4Shop (2, 'ajen')
    call RegItemCat4Shop (2, 'evtl')
    call RegItemCat4Shop (2, 'lgdh')
    call RegItemCat4Shop (2, 'desc')
    call RegItemCat4Shop (2, 'brac')
    call RegItemCat4Shop (2, 'ward')

    call RegItemCat4Shop (3, 'rlif')
    call RegItemCat4Shop (3, 'spsh')
    call RegItemCat4Shop (3, 'cnob')
    call RegItemCat4Shop (3, 'hval')
    call RegItemCat4Shop (3, 'ccmd')

    call RegItemCat4Shop (4, 'I001')
    call RegItemCat4Shop (4, 'I000')
    call RegItemCat4Shop (4, 'I00J')

    call RegItemCat4Shop (5, 'phea')
    call RegItemCat4Shop (5, 'pman')

    call RegItemCat4Shop (5, 'pghe')
    call RegItemCat4Shop (5, 'pgma')

    call RegItemCat4Shop (5, 'I00S')
 
    call RegItemCat4Shop (6, 'mcou')
    loop
        exitwhen i > 20
        call RegItem4Shop (1, 1, 'ckng', 0)
        call RegItem4Shop (1, 2, 'ckng', 0)
        call RegItem4Shop (1, 3, 'ckng', 0)
        call RegItem4Shop (1, 4, 'rin1', 0)
        call RegItem4Shop (1, 5, 'rin1', 0)
        call RegItem4Shop (1, 6, 'rin1', 0)
        call RegItem4Shop (1, 7, 'rag1', 0)
        call RegItem4Shop (1, 8, 'rag1', 0)
        call RegItem4Shop (1, 9, 'rag1', 0)
        call RegItem4Shop (1, 10, 'sbch', 0)
        call RegItem4Shop (2, 1, 'rat9', 0)
        call RegItem4Shop (2, 2, 'rde3', 0)
        call RegItem4Shop (2, 3, 'rde1', 0)
        call RegItem4Shop (2, 4, 'ajen', 0)
        call RegItem4Shop (2, 5, 'evtl', 0)
        call RegItem4Shop (2, 6, 'lgdh', 0)
        call RegItem4Shop (2, 7, 'desc', 0)
        call RegItem4Shop (2, 8, 'brac', 0)
        call RegItem4Shop (2, 9, 'ward', 0)
        call RegItem4Shop (3, 1, 'rlif', 0)
        call RegItem4Shop (3, 2, 'spsh', 0)
        call RegItem4Shop (3, 3, 'cnob', 0)
        call RegItem4Shop (5, 3, 'pghe', 0)
        call RegItem4Shop (5, 4, 'pgma', 0)
        set i = i + 1
    endloop

    call RegItem4Shop (3, 4, 'hval', 4)
    call RegItem4Shop (3, 5, 'ccmd', 1)
    call RegItem4Shop (3, 5, 'ccmd', 2)
    call RegItem4Shop (3, 5, 'ccmd', 3)

    call RegItem4Shop (4, 1, 'I001', 1)
    call RegItem4Shop (4, 1, 'I002', 1)
    call RegItem4Shop (4, 1, 'I003', 1)
    call RegItem4Shop (4, 1, 'I004', 1)
    call RegItem4Shop (4, 1, 'I005', 1)
    call RegItem4Shop (4, 1, 'I006', 1)
    call RegItem4Shop (4, 2, 'I000', 1)
    call RegItem4Shop (4, 3, 'I00R', 0)
    call RegItem4Shop (4, 3, 'I008', 0)
    call RegItem4Shop (4, 3, 'I00Q', 0)
    call RegItem4Shop (4, 3, 'I009', 0)
    call RegItem4Shop (4, 3, 'I007', 0)
    call RegItem4Shop (4, 3, 'I00G', 0)
    call RegItem4Shop (4, 3, 'I00H', 0)
    call RegItem4Shop (4, 3, 'I00M', 0)
    call RegItem4Shop (4, 3, 'I00J', 0)
    call RegItem4Shop (4, 3, 'I00A', 0)
    call RegItem4Shop (4, 3, 'I00B', 0)
    call RegItem4Shop (4, 3, 'I00C', 0)
    call RegItem4Shop (4, 3, 'I00D', 0)
    call RegItem4Shop (4, 3, 'I00E', 0)
    call RegItem4Shop (4, 3, 'I00F', 0)
    call RegItem4Shop (4, 3, 'I00I', 0)
    call RegItem4Shop (4, 3, 'I00K', 0)
    call RegItem4Shop (4, 3, 'I00L', 0)
    call RegItem4Shop (4, 3, 'I00N', 0)
    call RegItem4Shop (4, 3, 'I00O', 0)
    call RegItem4Shop (4, 3, 'I00O', 30)
    call RegItem4Shop (4, 3, 'I00P', 0)
    call RegItem4Shop (4, 3, 'I00P', 20)

    call RegItem4Shop (5, 1, 'phea', 1)
    call RegItem4Shop (5, 1, 'phea', 10)
    call RegItem4Shop (5, 1, 'phea', 50)
    call RegItem4Shop (5, 2, 'pman', 1)
    call RegItem4Shop (5, 2, 'pman', 10)
    call RegItem4Shop (5, 2, 'pman', 50)

    call RegItem4Shop (5, 5, 'I00S', 0)
    call RegItem4Shop (5, 5, 'I00T', 0)

    call RegItem4Shop (6, 1, 'mcou', 0)
    call RegItem4Shop (6, 1, 'I00U', 0)

    call RegCraft('I002', 'I001', 3, 'I000', 2, 0, 0)
    call RegCraft('I003', 'I002', 3, 'I000', 2, 0, 0)

    call RegCraft('ckng', 'I00M', 2, 'I00G', 1, 'I00H', 1)
    call RegCraft('rin1', 'I00M', 3, 'I00G', 1, 'I00H', 1)
    call RegCraft('rag1', 'I00M', 1, 'I00G', 1, 'I00H', 1)
    call RegCraft('sbch', 'I007', 1, 'I00G', 1, 'I00J', 4)
    call RegCraft('rlif', 'I00R', 1, 'I00J', 2, 0, 0)
    call RegCraft('spsh', 'I00R', 1, 'I00J', 2, 0, 0)
    call RegCraft('I00R', 'I008', 1, 'I00Q', 1, 'I009', 1)

    call RegCraft('rat9', 'I00G', 3, 'I00H', 1, 'I00J', 2)
    call RegCraft('rde3', 'I00G', 3, 'I00H', 1, 'I00J', 2)
    call RegCraft('rde1', 'I00G', 2, 'I00H', 1, 'I00J', 3)
    call RegCraft('evtl', 'I00G', 3, 'I00H', 2, 'I00J', 1)
    call RegCraft('ajen', 'I00G', 3, 'I00H', 2, 'I00J', 1)
    call RegCraft('lgdh', 'I00G', 1, 'I00H', 4, 'I00J', 1)
    call RegCraft('desc', 'I00G', 2, 'I00H', 3, 'I00J', 1)
    call RegCraft('ward', 'I00G', 1, 'I00H', 2, 'I00J', 3)
    call RegCraft('brac', 'I00G', 1, 'I00H', 3, 'I00J', 2)
    call RegCraft('ccmd', 'I00O', 99, 'I000', 20, 0, 0)
    call RegCraft('hval', 'I00P', 20, 0, 0, 0, 0)
    call RegCraft('pghe', 'I00E', 2, 'I00C', 1, 'I00D', 1)
    call RegCraft('pgma', 'I00F', 1, 'I00I', 2, 'I00B', 1)

    call RegCraft('I00S', 'I00L', 3, 'I00E', 3, 'I00A', 3)
    call RegCraft('I00T', 'I00C', 3, 'I00F', 3, 'I00K', 3)

//Create Catalog for unique items
    call SaveInteger(udg_CItem_Table, - 1, 2, 9) //itype
    call SaveInteger(udg_CItem_Table, - 1, 3, 0) //subtype
    call SaveInteger(udg_CItem_Table, - 1, 7, 30) //grade
    call SaveInteger(udg_CItem_Table, - 1, 8, 30) //lv req
    call SaveInteger(udg_CItem_Table, - 1, 20, 12) //socket
    call SaveInteger(udg_CItem_Table, - 1, 50, 30) //attack lv
    call SaveInteger(udg_CItem_Table, - 1, 51, 30) //def lv

    call SaveInteger(udg_CItem_Table, - 2, 2, 9) //itype
    call SaveInteger(udg_CItem_Table, - 2, 3, 0) //subtype
    call SaveInteger(udg_CItem_Table, - 2, 7, 30) //grade
    call SaveInteger(udg_CItem_Table, - 3, 8, 30) //lv req
    call SaveInteger(udg_CItem_Table, - 2, 20, 12) //socket
    call SaveInteger(udg_CItem_Table, - 2, 50, 45) //attack lv
    call SaveInteger(udg_CItem_Table, - 2, 51, 15) //def lv

    call SaveInteger(udg_CItem_Table, - 3, 2, 9) //itype
    call SaveInteger(udg_CItem_Table, - 3, 3, 0) //subtype
    call SaveInteger(udg_CItem_Table, - 3, 7, 30) //grade
    call SaveInteger(udg_CItem_Table, - 3, 8, 30) //lv req
    call SaveInteger(udg_CItem_Table, - 3, 20, 12) //socket
    call SaveInteger(udg_CItem_Table, - 3, 50, 15) //attack lv
    call SaveInteger(udg_CItem_Table, - 3, 51, 45) //def lv

    call SaveInteger(udg_CItem_Table, - 4, 2, 10) //itype
    call SaveInteger(udg_CItem_Table, - 4, 3, 0) //subtype
    call SaveInteger(udg_CItem_Table, - 4, 7, 30) //grade
    call SaveInteger(udg_CItem_Table, - 4, 22, 50) //drop
    call SaveInteger(udg_CItem_Table, - 4, 23, 50) //exp
    call SaveInteger(udg_CItem_Table, - 4, 24, 50) // > 
    call SaveInteger(udg_CItem_Table, - 4, 81, 50) //shop discount

    set i = 1
    set udg_Pow2[0] = 1
    loop
        exitwhen i > 24
        set udg_Pow2[i] = udg_Pow2[i - 1] * 2
        set i = i + 1
    endloop

    call DisableTrigger( GetTriggeringTrigger() )
endfunction

//===========================================================================
function InitTrig_Map_init takes nothing returns nothing
    set gg_trg_Map_init = CreateTrigger()
    call TriggerRegisterTimerEvent( gg_trg_Map_init, 0.01, false )
    call TriggerAddAction( gg_trg_Map_init, function Trig_map_init_Actions )
endfunction
Last edited:
Top