Jump to content
  • 0

help me to fix this script please.


Cisqua

Question


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   1
  • Joined:  12/29/12
  • Last Seen:  

anyone can help me to fix this script?

 

normal player click this npc, player will warp, but if gmlvl99 click the npc the menu will show.

 

this code is right?

    disablenpc "Mall Warper";
    disablenpc "Exit";
    
    sleep 3000;
    loadnpc "npc/gNPC/shop script/mall_shop.txt"
    dispbottom "finish reloading mall shop.";
end;
 

 


 

 

quiz_02,337,83,5	script	Exit	869,{
	warp "prontera" ,156,156;

menu "Cancel",Close,"Reload Shop",Reloadshop,"Kill Boss",Reloadboss;

//===========       CANCEL       ===========\\
Close:
end;

//===========  RELOAD MALL SHOP  ===========\\
Reloadshop:
	disablenpc "Headgear 1#SM";
	disablenpc "Headgear 2#SM";
	disablenpc "Armor#SM";
	disablenpc "Shield#SM";
	disablenpc "Garment#SM";
	disablenpc "Footgear#SM";
	disablenpc "Accessory#SM";
	disablenpc "One-handed Sword#SM";
	disablenpc "Two-handed Sword#SM";
	disablenpc "One-handed Spear#SM";
	disablenpc "Two-handed Spear#SM";
	disablenpc "One-handed Axe#SM";
	disablenpc "Two-handed Axe#SM";
	disablenpc "Katar#SM";
	disablenpc "Dagger#SM";
	disablenpc "Rod & Staff#SM";
	disablenpc "Bow#SM";
	disablenpc "Mace#SM";
	disablenpc "Knuckle#SM";
	disablenpc "Whip#SM";
	disablenpc "Musical Instrument#SM";
	disablenpc "Books#SM";
	disablenpc "Gun & Rifle#SM";
	disablenpc "Fuuma Shuriken#SM";
	disablenpc "Ammunition#SM";
	disablenpc "Novice Shop#SM";
	disablenpc "Blacksmith Shop#SM";
	disablenpc "Alchemist Shop#SM";
	disablenpc "Healing Item#SM";
	disablenpc "Stats Food#SM";
	disablenpc "Usable Item#SM";
	disablenpc "Pet Store#SM";
	disablenpc "Wedding Shop#SM";
	disablenpc "Mall Warper";
	disablenpc "Exit";
	
    sleep 3000;
    loadnpc "npc/gNPC/shop script/mall_shop.txt"
    dispbottom "finish reloading mall shop.";
end;


//===========  RELOAD BOSS AND MINI BOSS  ===========\\
Reloadboss:
	killmonsterall "abbey02";		// Fallen Bishop Hibram
	killmonsterall "abbey03";		// Beelzebub
	killmonsterall "abyss_03";		// Detale
	killmonsterall "ama_dun03";		// Samurai Specter
	killmonsterall "anthell02";		// Maya
	killmonsterall "ayo_dun02";		// Lady Tanee
	killmonsterall "beach_dun";		// Tao Gunka
	killmonsterall "ein_dun02";		// RSX-0806
	killmonsterall "gef_dun01";		// Dracula
	killmonsterall "gef_dun02";		// Doppelganger
	killmonsterall "gef_fild02";		// Orc Hero
	killmonsterall "gef_fild10";		// Orc Lord
	killmonsterall "gef_fild14";		// Orc Hero
	killmonsterall "gl_chyard";		// Dark Lord
	killmonsterall "gld_dun01";		// Eddga
	killmonsterall "gld_dun02";		// Doppelganger
	killmonsterall "gld_dun03";		// Maya
	killmonsterall "gld_dun04";		// Dark Lord
	killmonsterall "gon_dun03";		// Evil Snake Lord
	killmonsterall "ice_dun03";		// Ktullanux
	killmonsterall "in_sphinx5";		// Pharaoh
	killmonsterall "jupe_core";		// Vesper
	killmonsterall "kh_dun02";		// Kiel D-01
	killmonsterall "lhz_dun02";		// Egnigem Cenia
	// killmonsterall "lhz_dun03";		// Assassin Cross Eremes, High Priest Margaretha, High Wizard Kathryne, Lord Knight Seyren, Sniper Cecil, Whitesmith Howard
	killmonsterall "lou_dun03";		// White Lady
	killmonsterall "mjolnir_04";		// Mistress
	killmonsterall "moc_fild17";		// Phreeoni
	killmonsterall "moc_pryd04";		// Osiris
	killmonsterall "moc_pryd06";		// Amon Ra
	killmonsterall "mosk_dun03";		// Zmey Gorynych
	killmonsterall "niflheim";		// Lord of Death
	killmonsterall "odin_tem03";		// Valkyrie Randgris
	killmonsterall "pay_dun04";		// Moonlight Flower
	killmonsterall "pay_fild11";		// Eddga
	killmonsterall "prt_maze03";		// Baphomet
	killmonsterall "prt_sewb4";		// Golden Thief Bug
	killmonsterall "ra_fild02";		// Atroce
	killmonsterall "ra_fild03";		// Atroce
	killmonsterall "ra_fild04";		// Atroce
	killmonsterall "ra_san05";		// Gloom Under Night
	killmonsterall "thor_v03";		// Ifrit
	killmonsterall "treasure02";		// Drake
	killmonsterall "tur_dun04";		// Turtle General
	killmonsterall "ve_fild01";		// Atroce
	killmonsterall "ve_fild02";		// Atroce
	killmonsterall "xmas_dun02";		// Stormy Knight
	killmonsterall "xmas_fild01";		// Garm
	
	dispbottom "finish reloading boss monster's.";
end;
}	

Edited by Cisqua
Link to comment
Share on other sites

9 answers to this question

Recommended Posts


  • Group:  Members
  • Topic Count:  0
  • Topics Per Day:  0
  • Content Count:  9
  • Reputation:   4
  • Joined:  12/15/11
  • Last Seen:  

First off, disablenpc only disables the npc until you enable it again. Imo, this does not unload the npc. So when you load the mall shop npcs back in, they'll be on the server twice, basically.

 

Info disablenpc

* disablenpc "npcname";
* enablenpc "npcname";
 
These two commands will disable and enable, respectively, an NPC object
specified by name. The disabled NPC will disappear from sight and will no longer
be triggerable in the normal way. It is not clear whether it will still be
accessible through 'donpcevent' and other triggering commands, but it probably
will be. You can disable even warp NPCs if you know their object names, which is
an easy way to make a map only accessible through walking half the time. Then
you 'enablenpc' them back.

You can also use these commands to create the illusion of an NPC switching
between several locations, which is often better than actually moving the NPC -
create one NPC object with a visible and a hidden part to their name, make a few
copies, and then disable all except one.

 
use the commands @unloadnpc and @loadnpc in the script instead, maybe, or edit the source to be able reload only a single script (just want to show you all options, doubt you can do the 2nd option though)
 
 
 
 
 
Also, when you kill all monsters on a map, this does not reset the timer of the mobs.
For instance, when there's Garm up and you kill all monsters on the map, Garm will have its full respawn time again.
If Garm would not be up and you kill all mosnters on the map, Garm's timer will not reset and still spawn after its current timer.
Easiest method would be to reload the whole mobdb, however that would result in respawning other mobs that have a timer too.
Otherwise, you could let the mvps spawn from an extern npc script and just reload that one single script with the method you used at the mall shop npcs.
 
 
 
 
If you want to do a GM check to warp all players below a certain gm lvl you can do
 
*getgmlevel();


This function will return the GM level of the account to which the invoking
character belongs. If this is somehow executed from a console command, 99 will
be returned, and 0 will be returned if the account has no GM level.

This allows you to make NPC's only accessable for certain GM levels, or behave
specially when talked to by GMs.

if (getgmlevel()) mes "What is your command, your godhood?";
if (getgmlevel()) goto Wherever;

 

an if-clause would look like this

 

if ( getgmlevel() < 99 ) { x }

if the GM-level is lower than 99 , then do x

 

 

 

 

Hope I could help you a bit

maybe you can even fix it on your own now :)

Just try around, learning by doing!

Edited by HollyEnix
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   1
  • Joined:  12/29/12
  • Last Seen:  

this is the script ive done but something wrong with this script.. about unloadnpc and loadnpc what is the correct script command for this?

 

 

quiz_02,337,83,5    script    Exit    869,{
    if (getgmlevel() >= 99) goto MENU_Admin;
    warp "prontera" ,156,156;
end;

MENU_Admin:
menu "Cancel",Close,"Reload Shop",Reloadshop;


//===========   WARP PRONTERA   ===========\\
Warp:
    warp "prontera" ,156,156;    end;


//===========       CANCEL       ===========\\
Close:
end;


//===========  RELOAD MALL SHOP  ===========\\
Reloadshop:
    unloadnpc "Headgear 1#SM";
    unloadnpc "Headgear 2#SM";
    unloadnpc "Armor#SM";
    unloadnpc "Shield#SM";
    unloadnpc "Garment#SM";
    unloadnpc "Footgear#SM";
    unloadnpc "Accessory#SM";
    unloadnpc "One-handed Sword#SM";
    unloadnpc "Two-handed Sword#SM";
    unloadnpc "One-handed Spear#SM";
    unloadnpc "Two-handed Spear#SM";
    unloadnpc "One-handed Axe#SM";
    unloadnpc "Two-handed Axe#SM";
    unloadnpc "Katar#SM";
    unloadnpc "Dagger#SM";
    unloadnpc "Rod & Staff#SM";
    unloadnpc "Bow#SM";
    unloadnpc "Mace#SM";
    unloadnpc "Knuckle#SM";
    unloadnpc "Whip#SM";
    unloadnpc "Musical Instrument#SM";
    unloadnpc "Books#SM";
    unloadnpc "Gun & Rifle#SM";
    unloadnpc "Fuuma Shuriken#SM";
    unloadnpc "Ammunition#SM";
    unloadnpc "Novice Shop#SM";
    unloadnpc "Blacksmith Shop#SM";
    unloadnpc "Alchemist Shop#SM";
    unloadnpc "Healing Item#SM";
    unloadnpc "Stats Food#SM";
    unloadnpc "Usable Item#SM";
    unloadnpc "Pet Store#SM";
    unloadnpc "Wedding Shop#SM";
    unloadnpc "Mall Warper";
    unloadnpc "Exit";
    
    sleep 3000; // 3 seconds before loading script
    loadnpc "npc/mall_shop.txt"
dispbottom "finish reloading mall shop.";
end;
}   
 
Edited by Cisqua
Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  11
  • Topics Per Day:  0.00
  • Content Count:  115
  • Reputation:   4
  • Joined:  10/25/12
  • Last Seen:  


if ( getgroupid() < 99 ) { x }

Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   1
  • Joined:  12/29/12
  • Last Seen:  

i have this error in my map server Emistry.

[Error]:  Loading NPC file: npc/Test Script/test.txt
script error on npc/Test Script/test.txt line 46
    parse_line: expect command, missing function name or calling undeclared func
tion
    41 :                        disablenpc "Pet Store#SM";
    42 :                        disablenpc "Wedding Shop#SM";
    43 :                        disablenpc "Mall Warper";
    44 :                        disablenpc "Exit";
    45 :                        sleep2 3000;
*   46 :                        'l'oadnpc "npc/gNPC/shop script/mall_shop.txt"
    47 :                        dispbottom "finish reloading mall shop.";
    48 :                        break;
    49 :        }
    50 : close;
    51 : }
 
Edited by Cisqua
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  

isnt that your own script ? i thought you have some custom loadnpc / unloadnpc script command to load npc... ?

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   1
  • Joined:  12/29/12
  • Last Seen:  

nope i dont have... so what command should i use?

 

atcommand @loadnpc "npc/gNPC/shop script/mall_shop.txt"?

Edited by Cisqua
Link to comment
Share on other sites


  • Group:  Forum Moderator
  • Topic Count:  93
  • Topics Per Day:  0.02
  • Content Count:  10015
  • Reputation:   2350
  • Joined:  10/28/11
  • Last Seen:  


atcommand "@loadnpc npc/......mallshop.txt";

 

Link to comment
Share on other sites


  • Group:  Members
  • Topic Count:  46
  • Topics Per Day:  0.01
  • Content Count:  131
  • Reputation:   1
  • Joined:  12/29/12
  • Last Seen:  

@Emistry

the shop is not unload it just hide and when i used the script all shop will be duplicate..

 

i have this now. but my get this.

 

[Error]: Server received crash signal! Attempting to save all online characters!
Map-Server has crashed!

 

quiz_02,335,74,5    script    Exit    869,{
    switch( select( "Warp",
                    ( getgmlevel() < 99 )?"":"Reload Shop" )){
                    
        Case 1:
            warp "prontera" ,156,156;
            break;
        Case 2:
            atcommand "@unloadnpc Headgear 1#SM";
            sleep2 500;
            atcommand "@unloadnpc Headgear 2#SM";
            sleep2 500;
            atcommand "@unloadnpc Armor#SM";
            sleep2 500;
            atcommand "@unloadnpc Shield#SM";
            sleep2 500;
            atcommand "@unloadnpc Garment#SM";
            sleep2 500;
            atcommand "@unloadnpc Footgear#SM";
            sleep2 500;
            atcommand "@unloadnpc Accessory#SM";
            sleep2 500;
            atcommand "@unloadnpc One-handed Sword#SM";
            sleep2 500;
            atcommand "@unloadnpc Two-handed Sword#SM";
            sleep2 500;
            atcommand "@unloadnpc One-handed Spear#SM";
            sleep2 500;
            atcommand "@unloadnpc Two-handed Spear#SM";
            sleep2 500;
            atcommand "@unloadnpc One-handed Axe#SM";
            sleep2 500;
            atcommand "@unloadnpc Two-handed Axe#SM";
            sleep2 500;
            atcommand "@unloadnpc Katar#SM";
            sleep2 500;
            atcommand "@unloadnpc Dagger#SM";
            sleep2 500;
            atcommand "@unloadnpc Rod & Staff#SM";
            sleep2 500;
            atcommand "@unloadnpc Bow#SM";
            sleep2 500;
            atcommand "@unloadnpc Mace#SM";
            sleep2 500;
            atcommand "@unloadnpc Knuckle#SM";
            sleep2 500;
            atcommand "@unloadnpc Whip#SM";
            sleep2 500;
            atcommand "@unloadnpc Musical Instrument#SM";
            sleep2 500;
            atcommand "@unloadnpc Books#SM";
            sleep2 500;
            atcommand "@unloadnpc Gun & Rifle#SM";
            sleep2 500;
            atcommand "@unloadnpc Fuuma Shuriken#SM";
            sleep2 500;
            atcommand "@unloadnpc Ammunition#SM";
            sleep2 500;
            atcommand "@unloadnpc Novice Shop#SM";
            sleep2 500;
            atcommand "@unloadnpc Blacksmith Shop#SM";
            sleep2 500;
            atcommand "@unloadnpc Alchemist Shop#SM";
            sleep2 500;
            atcommand "@unloadnpc Healing Item#SM";
            sleep2 500;
            atcommand "@unloadnpc Stats Food#SM";
            sleep2 500;
            atcommand "@unloadnpc Usable Item#SM";
            sleep2 500;
            atcommand "@unloadnpc Pet Store#SM";
            sleep2 500;
            atcommand "@unloadnpc Wedding Shop#SM";
            sleep2 500;
            atcommand "@unloadnpc Mall Warper";
            sleep2 500;
            atcommand "@unloadnpc Exit";
            sleep2 3000;
            atcommand "@loadnpc npc/Test Script/mall.txt";
            dispbottom "finish reloading mall shop.";
            break;
    }
close;
}
 
Edited by Cisqua
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...