CreatureEvent [Monster/Talkactions] Metin Stone Event

Discussion in 'GlobalEvents, Spells & CreatureEvents' started by kawon, Nov 2, 2011.

  1. kawon

    kawon o.O

    Joined:
    Mar 16, 2009
    Messages:
    549
    Likes Received:
    20
    Best Answers:
    0
    Hello :)

    This is very popular Metin Stone Event :)

    How this work?
    1.Change place when metin stone can respawn.
    2.Say /metin xxx (xxx this is name stone, np. /metin Icy Stone)

    Reward change in creaturescripts/metin_kill.lua


    To creaturescripts.xml add:
    PHP:
    1. <event type="death" name="metin_death" event="script" value="metin_kill.lua"/>  
    2. <event type="combat" name="Kamulec" event="script" value="metin_stones.lua"/>  
    To login.lua add:
    PHP:
    1.     registerCreatureEvent(cid, "Kamulec")
    2.     registerCreatureEvent(cid, "metin_death")
    This is script (metin_kill.lua) when player kill stones then get points to sms shop:
    PHP:
    1. local config = {
    2.     points = 5, -- how many points winner get?
    3.     }
    4.  
    5.     local names = {'earth stone', 'icy stone', 'fire stone', 'wind stone'}
    6.  
    7. function onDeath(cid, corpse, deathList)
    8.     if (isInArray(names, getCreatureName(cid):lower())) then
    9.         --local mostdmg = deathList[2] ~= nil and deathList[2] or deathList[1]
    10.         local mostdmg = isPlayer(deathList[1]) and deathList[1] or (deathList[2] ~= nil and deathList[2])
    11.         if isPlayer(mostdmg) then
    12.        
    13.             db.executeQuery("UPDATE `accounts` SET `premium_points` = `premium_points` +" .. config.points .. " WHERE `name` = '".. getAccountByName(getCreatureName(mostdmg)) .."';")
    14.             doPlayerSendTextMessage(mostdmg, 22, "You have killed " .. getCreatureName(cid) .. ". You won 5 points to sms shop.")
    15.             db.executeQuery("INSERT INTO metin_wins (name, reward, reward_id, stone, date) VALUES ('" .. getCreatureName(mostdmg) .. "', '5 points', '2', '" .. getCreatureName(cid) .. "', " .. os.time() .. ")")
    16.        
    17.         else
    18.             doBroadcastMessage("No one has destroyed the stone")
    19.         end
    20.     end
    21.     return TRUE

    This is web script (gesior acc):
    PHP:
    1. <?PHP
    2.  
    3. $main_content .='<center><br><br><font color="green"><h2>Metin Stone Event</h2></font></center>';
    4. $main_content .='<p><strong>N</strong>asz serwer został urozmaicony o system kamieni Metin. Co jakiś czas w jednym z miejsc poza miastem (przy drogach) pojawia się kamien metin o losowym żywiole. Gracz zostanie poinformowany o zrespieniu się kamienia komunikatem: <u><i> Icy Stone have been spawn. Find and defeat it!</i></u> Miejscówki na mapie w których może pojawić się kamień: </p>
    5. <p>Zadaniem gracza jest zniszczyć kamień. Nie jest to jednak takie łatwe, kamienie summują potwory które utrudniają ci zadanie. Warto najpierw skupić się na potworach, a później dopiero na niszczeniu kamienia. Czym więcej kamień traci życia tym bardziej jest niebezpieczny. Osoba która zada najwieksze obrażenia kamieniowi otrzyma 5 premium points.</p>';
    6.  
    7.  
    8. $main_content .= '<center><table width="100%"> <tr > <td width="100" align="center" bgcolor="'.$config['site']['darkborder'].'"><img src="http://noveria.pl/images/items/Mossy_Stone.gif"></td> <td  bgcolor="'.$config['site']['darkborder'].'"><strong>Earth Stone:</strong><br /><strong>HP:</strong> 200000 <br /><strong>Monsters:</strong> Carniphila, Earth Elemental, Bog Raider, Giant Spider, Hydra, Lich, Serpent Spawn, Defiler, Medusa, Lost Soul, Son of Verminor, Juggernaut <br /><strong>Special:</strong> healing, paralyze</td>  </tr>
    9. <tr><td align="center" bgcolor="'.$config['site']['lightborder'].'"><img src="http://noveria.pl/images/items/Blue_Shrine_Stone.gif"></td><td bgcolor="'.$config['site']['lightborder'].'"><strong>Icy Stone:</strong> <br /><strong>HP:</strong> 200000 <br /><strong>Monsters:</strong> ice golem, frost dragon hatchling, crystal spider, frost dragon,  yeti<br /><strong>Special:</strong> strong healing</td> </tr>
    10.  
    11. <tr><td align="center" bgcolor="'.$config['site']['darkborder'].'"><img src="http://noveria.pl/images/items/Red_Shrine_Stone.gif"></td><td  bgcolor="'.$config['site']['darkborder'].'"><strong>Fire Stone:</strong>  <br /><strong>HP:</strong> 200000 <br /> <strong>Monsters:</strong> Fire Elemental, Dragon,   Dragon Lord Hatchling, Dragon Lord, Diabolic Imp, Demodras, Hellfire Fighter, Hellhound, Demon <br /><strong>Special:</strong> healing</td>  </tr>
    12. <tr><td align="center" bgcolor="'.$config['site']['lightborder'].'"><img src="http://noveria.pl/images/items/Stone_(Normal).gif"></td><td bgcolor="'.$config['site']['lightborder'].'"><strong>Wind Stone:</strong> <br /><strong>HP: </strong> 200000 <br /><strong>Monsters:</strong> Gargoyle, Stone Golem, Black Knight, Behemoth, Destroyer, Betrayed Wraith, Dark Torturer, Grim Reaper, Blightwalker, Undead Dragon<br /><strong>Special:</strong> healing</td> </tr>
    13. </table></center>';
    14.  
    15.  
    16.  
    17.  
    18. $metin_wins = $SQL->query('SELECT * FROM metin_wins ORDER BY date DESC LIMIT 5')->fetchAll();
    19.  
    20. $main_content .= '<center><font color="green"><h2>Last 5 Metin Stone killers</h2></font></center>';
    21.  
    22. if ($metin_wins){
    23.     $main_content .= '<table border="0" cellspacing="1" cellpadding="4" width="100%">
    24.     <tr bgcolor="'.$config['site']['vdarkborder'].'"">         
    25.         <td width="10%" class="white" style="text-align: center; font-weight: bold;">#</td>
    26.  
    27.         <td width="20%" class="white" style="text-align: center; font-weight: bold;">Player</td>
    28.         <td width="25%" class="white" style="text-align: center; font-weight: bold;">Reward</td>
    29.         <td width="25%" class="white" style="text-align: center; font-weight: bold;">Stone</td>    
    30.         <td wdith="25%" class="white" style="text-align: center; font-weight: bold;">Date</td>
    31.     </tr>';
    32.     $i = 1;
    33.     foreach ($metin_wins as $mm){
    34.         $file = './images/items/'.$mm['reward_id'].'.gif';
    35.         $img = is_file($file) ? '<img src="'.$file.'" alt="'.$mm['reward'].'">' : $mm['reward'];
    36.         $bg = (is_int($i/2)) ? $config['site']['lightborder'] : $config['site']['darkborder'];
    37.         $main_content .= '<tr align="center" bgcolor="'.$bg.'"><td>'.$i.'</td><td><a href="?subtopic=characters&name='.$mm['name'].'">'.$mm['name'].'</a></td><td>'.$img.'</td><td>'.$mm['stone'].'</td><td>'.date('Y-m-d H:i', $mm['date']).'</td></tr>';
    38.         $i++;
    39.     }
    40.     $main_content .= '</table>';
    41. }
    42. else{
    43.     $main_content .= 'No one killed stone';
    44. }
    45.  
    46.  
    47. ?>

    SQL:

    PHP:
    1. CREATE TABLE IF NOT EXISTS `metin_wins` (
    2.   `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
    3.   `name` varchar(40) NOT NULL DEFAULT '',
    4.   `reward` varchar(20) NOT NULL DEFAULT '',
    5.   `date` bigint(20) unsigned NOT NULL,
    6.   `reward_id` int(11) NOT NULL DEFAULT '0',
    7.   `stone` varchar(20) NOT NULL DEFAULT '',
    8.   PRIMARY KEY (`id`)
    9. ) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
     

    Attached Files:

    Last edited: Nov 7, 2011
    DanJ93 and adix1310 like this.
  2. sloox

    sloox New Member

    Joined:
    Aug 13, 2007
    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    hi
    when i summon any stone i see warning in console
    [Warning - Monster::Monster] Unknown event name - metin_death
     
  3. Artis

    Artis Artist

    Joined:
    Jun 15, 2009
    Messages:
    341
    Likes Received:
    10
    Best Answers:
    0
    You add it to creaturescript/login.lua - register etc.. and to creaturescript.xml. You can see too in a monster :)
     
  4. sloox

    sloox New Member

    Joined:
    Aug 13, 2007
    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    i add to login.lua
    and to creaturescript.xml

    please help ;p

    #edit
    why in monsters files are
    what is that ?
     
  5. kawon

    kawon o.O

    Joined:
    Mar 16, 2009
    Messages:
    549
    Likes Received:
    20
    Best Answers:
    0
    I edit first post :)

    Add:
    - script to web (gesior acc)
    - commands to creaturescripts.xml and login.lua
    - add new version with premium points (when player kill stones then get premium points to sms shop)
     
  6. sloox

    sloox New Member

    Joined:
    Aug 13, 2007
    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    any table to detabase ?
     
  7. Azi

    Azi Banned User

    Joined:
    Aug 12, 2007
    Messages:
    1,167
    Likes Received:
    56
    Best Answers:
    0
    nope, no need.
     
  8. sloox

    sloox New Member

    Joined:
    Aug 13, 2007
    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    it need table metin_wins

     
  9. Tapcioo

    Tapcioo Faleria.eu - 2016

    Joined:
    Jun 1, 2009
    Messages:
    453
    Likes Received:
    269
    Best Answers:
    0
    @ up

    Create a new table, if you done creating table click ,,SQL" and paste:

    All work's, thx.
     
    Last edited: Nov 6, 2011
  10. kawon

    kawon o.O

    Joined:
    Mar 16, 2009
    Messages:
    549
    Likes Received:
    20
    Best Answers:
    0
    In first post I added inquiry sql
    bye
     
  11. Optus

    Optus GeorgeB.

    Joined:
    Aug 30, 2011
    Messages:
    391
    Likes Received:
    11
    Best Answers:
    0
    Nice script
     
  12. szatan1x

    szatan1x Professional Lua

    Joined:
    May 10, 2011
    Messages:
    605
    Likes Received:
    14
    Best Answers:
    0
    Nie dodales Icy Stone do monsters.
     
  13. Potar

    Potar SocialWorld

    Joined:
    Mar 1, 2009
    Messages:
    1,664
    Likes Received:
    120
    Best Answers:
    0
    Just read the date , haha lol i was nooooob :D
     
  14. anormalius

    anormalius New Member

    Joined:
    Dec 27, 2012
    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    plase help I attackstones and dont create spawn
     
  15. konolo22

    konolo22 Banned User

    Joined:
    Jan 18, 2013
    Messages:
    86
    Likes Received:
    1
    Best Answers:
    0
    have some problem =/
     
  16. anormalius

    anormalius New Member

    Joined:
    Dec 27, 2012
    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    I attack stones and don't create monsters
    need help fastttttt
     
  17. GOD Kubus

    GOD Kubus Member

    Joined:
    Dec 23, 2012
    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
    Why stone dont create monster?
     
  18. GOD Kubus

    GOD Kubus Member

    Joined:
    Dec 23, 2012
    Messages:
    60
    Likes Received:
    0
    Best Answers:
    0
  19. Snavy

    Snavy Alpha - AUUU

    Joined:
    Apr 1, 2012
    Messages:
    406
    Likes Received:
    22
    Best Answers:
    1
    Stones wont create monsters. idk why
     
  20. blazej123

    blazej123 New Member

    Joined:
    Feb 10, 2017
    Messages:
    1
    Likes Received:
    0
    Best Answers:
    0
    Mam problem , gdzie należy dodać WEB SKRYPT ?
    I have a provlem , where i must add This is web script (gesior acc): ??
     

Share This Page

Loading...