Jump to content
  • 0
DEsMOn

[Error]: buildin_strcharinfo: fatal error ! player not attached! Goblin Invasion

Question

Hello Everyone

I've Notice this error pop ups in CMD when player get rewards 

[Error]: buildin_strcharinfo: fatal error ! player not attached!
[Debug]: Function: strcharinfo (1 parameter):
[Debug]: Data: number value=0
[Debug]: Source (NPC): Invasion NPC at prontera (155,185)

Can some explain or guide how to fix this?

Thank you...

//================================================Name======================================================
                                    // Goblin Invasion NPC (Official Release Name)
//===============================================Version====================================================
//                                                  1.2 
//===============================================Author=====================================================
//                     ____ _____  ______  __ __   __  _______    __   _____ __   __  _______
//                    |  __ \ _  \|  __  \|  |  \ |  |/  ___  \  |  | /  /  |  \ |  |/  ___  \
//                    | |__| | \  \ |__|  |  |   \|  |  |  _\_/  |  |/  /|  |   \|  |  |  _\_/
//                    |   __/   | |      /|  |       |  | |_  \  |     | |  |    |  |  | |_  \
//                    |  |\  \_/  /  |\  \|  |  |\   |   \_/  |  |  |\  \|  |  |\   |   \_/  |
//                    |__| \_____/|__| \__\__|__| \__|\______/   |__| \__\__|__| \__|\______/
//----------------------------------------Script Last Update 2020-------------------------------------------
//==============================================Changelog===================================================
                                    // 1.0 *
                                    //        - Initial Release
                                    // 1.1
                                    //        - Added Host Event by GMAccess
                                    // 1.2
                                    //        - Remove all error from Latest rAthena
                                    //        - Maximize script
                                    //        - Fix some dialog of NPC
                                    //        - Added Mapflag for the Event Map 
//==========================================================================================================
prontera,155,185,6    script    Invasion NPC    459,{

set .gm,50;//GM Level to access the GM Menu. Default: 50

    // GM menu 
    //It allows GMs Level 50 or more to Start and Stop invasions.
    if (getgmlevel()>.gm) {
        if (.mobs_left) {
            mes "[Invasion]";
            mes "An invasion is in progress..";
            mes "Location: " + .Map$;
            mes "^FF0000"+.mobs_left+"^000000 Goblins left";
            mes " ";
            mes "Stop invasion?";
            if(select("No:Yes")==1) close;
            donpcevent "Invasion NPC::OnTimer1805000";
            mes "Invasion stopped";
            announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
            close;
        }
        mes "[Invasion]";
        mes "Please customize the Invasion event before starting it.";
        mes "Note - The Goblin Leader drops x5 of the prize.";
        Main:
        next;
        mes "[Invasion]";
            switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
        case 1:
            mes "Which item would you like the Goblin Leader to drop?";
            mes "Please input the item ID:";
            input .ItemID;
            goto Main;
        case 2:
            mes "Starting the event now...";
            close2;
            goto OnStart;
    }
    
    // If a player clicks the NPC, it displays:
    
    mes "[Invasion]";
    mes .mobs_left+" have invaded "+.Map$[.rand_map]+"!";
    close;
    
            /////////////////////////
            //The actual NPC Script//
            /////////////////////////
OnMinute50: // Change this to your liking
OnStart:
        set .mobs_left, 1;
        sleep 1000;
        set [email protected], rand(1,6);
        if ([email protected] == 6) set .Map$,"guild_vs3";
        if ([email protected] == 5) set .Map$,"guild_vs3";
        if ([email protected] == 4) set .Map$,"guild_vs3";
        if ([email protected] == 3) set .Map$,"guild_vs3";
        if ([email protected] == 2) set .Map$,"guild_vs3";
        if ([email protected] == 1) set .Map$,"guild_vs3";
        sleep 1000;
        announce "[ Rune-Midgard Guard ]: We have trouble here in the town " + .Map$ + "!", bc_all;
        sleep 5000;
        announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
        monster .Map$,0,0,"Goblin",1258,10,"Invasion NPC::OnMyMobDead";
        monster .Map$,0,0,"Goblin",1299,1,"Invasion NPC::OnMyMobDead";
        set .mobs_left, 11;
        end;
    
    
OnTimer1805000:    // 30 minutes later, kills all the mobs.
                killmonster .Map$,"Invasion NPC::OnMyMobDead";
                set .mobs_left, 0;

OnStop://When the event is stopped by a GM, or all monsters dead.
            killmonster .Map$,"Invasion NPC::OnMyMobDead";
            killmonster .Map$,"Invasion NPC::OnSpecialMobDead";
            announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;
            end;

OnMyMobDead: //When a Goblin is killed
            set .mobs_left, .mobs_left-1;
            if (.mobs_left==0) {
                announce "[ Rune-Midgard Guard ]: Everyone, thankyou for helping to get rid of these Goblins!", bc_all;
                getitem .ItemID,20; //Change the [5] to the amount you wish to hand out.
                donpcevent "Invasion NPC::OnStop";
                //announce "[Invasion NPC]: "+strcharinfo(0)+" has killed the last "+.mobname$+".",bc_all;

            } else {
                //announce "["+.mobs_left+"/200] Goblins left.",bc_map;
                //announce "["+.mobs_left+"-"+200+"="+.mobs_left+"] Goblins left.",bc_map;
                //announce "[("+.mobs_left+")-(200)="+.mobs_left+"] Goblins left.",bc_map;
                
                announce "[ "+strcharinfo(0)+" ] has killed a Goblin. There are now "+.mobs_left+" Goblin left.",bc_map;
            }
            end;
            }
            end;
}

 

Edited by Emistry
codebox
Link to comment
Share on other sites

2 answers to this question

Recommended Posts

  • 0
//================================================Name======================================================
                                    // Goblin Invasion NPC (Official Release Name)
//===============================================Version====================================================
//                                                  1.2 
//===============================================Author=====================================================
//                     ____ _____  ______  __ __   __  _______    __   _____ __   __  _______
//                    |  __ \ _  \|  __  \|  |  \ |  |/  ___  \  |  | /  /  |  \ |  |/  ___  \
//                    | |__| | \  \ |__|  |  |   \|  |  |  _\_/  |  |/  /|  |   \|  |  |  _\_/
//                    |   __/   | |      /|  |       |  | |_  \  |     | |  |    |  |  | |_  \
//                    |  |\  \_/  /  |\  \|  |  |\   |   \_/  |  |  |\  \|  |  |\   |   \_/  |
//                    |__| \_____/|__| \__\__|__| \__|\______/   |__| \__\__|__| \__|\______/
//----------------------------------------Script Last Update 2020-------------------------------------------
//==============================================Changelog===================================================
                                    // 1.0 *
                                    //        - Initial Release
                                    // 1.1
                                    //        - Added Host Event by GMAccess
                                    // 1.2
                                    //        - Remove all error from Latest rAthena
                                    //        - Maximize script
                                    //        - Fix some dialog of NPC
                                    //        - Added Mapflag for the Event Map 
//==========================================================================================================
prontera,155,185,6    script    Invasion NPC    459,{

set .gm,50;//GM Level to access the GM Menu. Default: 50

    // GM menu 
    //It allows GMs Level 50 or more to Start and Stop invasions.
    if (getgmlevel()>.gm) {
        if (.mobs_left) {
            mes "[Invasion]";
            mes "An invasion is in progress..";
            mes "Location: " + .Map$;
            mes "^FF0000"+.mobs_left+"^000000 Goblins left";
            mes " ";
            mes "Stop invasion?";
            if(select("No:Yes")==1) close;
            donpcevent "Invasion NPC::OnTimer1805000";
            mes "Invasion stopped";
            announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
            close;
        }
        mes "[Invasion]";
        mes "Please customize the Invasion event before starting it.";
        mes "Note - The Goblin Leader drops x5 of the prize.";
        Main:
        next;
        mes "[Invasion]";
            switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
        case 1:
            mes "Which item would you like the Goblin Leader to drop?";
            mes "Please input the item ID:";
            input .ItemID;
            goto Main;
        case 2:
            mes "Starting the event now...";
            close2;
            goto OnStart;
    }
    
    // If a player clicks the NPC, it displays:
    
    mes "[Invasion]";
    mes .mobs_left+" have invaded "+.Map$[.rand_map]+"!";
    close;
    
            /////////////////////////
            //The actual NPC Script//
            /////////////////////////
OnMinute50: // Change this to your liking
OnStart:
        set .mobs_left, 1;
        sleep 1000;
        set [email protected], rand(1,6);
        if ([email protected] == 6) set .Map$,"guild_vs3";
        if ([email protected] == 5) set .Map$,"guild_vs3";
        if ([email protected] == 4) set .Map$,"guild_vs3";
        if ([email protected] == 3) set .Map$,"guild_vs3";
        if ([email protected] == 2) set .Map$,"guild_vs3";
        if ([email protected] == 1) set .Map$,"guild_vs3";
        sleep 1000;
        announce "[ Rune-Midgard Guard ]: We have trouble here in the town " + .Map$ + "!", bc_all;
        sleep 5000;
        announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
        monster .Map$,0,0,"Goblin",1258,10,"Invasion NPC::OnMyMobDead";
        monster .Map$,0,0,"Goblin",1299,1,"Invasion NPC::OnMyMobDead";
        set .mobs_left, 11;
        end;
    
    
OnTimer1805000:    // 30 minutes later, kills all the mobs.
                killmonster .Map$,"Invasion NPC::OnMyMobDead";
                set .mobs_left, 0;

OnStop://When the event is stopped by a GM, or all monsters dead.
            killmonster .Map$,"Invasion NPC::OnMyMobDead";
            killmonster .Map$,"Invasion NPC::OnSpecialMobDead";
            end;

OnMyMobDead: //When a Goblin is killed
            set .mobs_left, .mobs_left-1;
            if (.mobs_left==0) {
                announce "[ Rune-Midgard Guard ]: Everyone, thankyou for helping to get rid of these Goblins!", bc_all;
                getitem .ItemID,20; //Change the [5] to the amount you wish to hand out.
                donpcevent "Invasion NPC::OnStop";
                //announce "[Invasion NPC]: "+strcharinfo(0)+" has killed the last "+.mobname$+".",bc_all;
				announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;

            } else {
                //announce "["+.mobs_left+"/200] Goblins left.",bc_map;
                //announce "["+.mobs_left+"-"+200+"="+.mobs_left+"] Goblins left.",bc_map;
                //announce "[("+.mobs_left+")-(200)="+.mobs_left+"] Goblins left.",bc_map;
                
                announce "[ "+strcharinfo(0)+" ] has killed a Goblin. There are now "+.mobs_left+" Goblin left.",bc_map;
            }
            end;
            }
            end;
}

 

  • Like 1
Link to comment
Share on other sites

  • 0
8 hours ago, Emistry said:
//================================================Name======================================================
                                    // Goblin Invasion NPC (Official Release Name)
//===============================================Version====================================================
//                                                  1.2 
//===============================================Author=====================================================
//                     ____ _____  ______  __ __   __  _______    __   _____ __   __  _______
//                    |  __ \ _  \|  __  \|  |  \ |  |/  ___  \  |  | /  /  |  \ |  |/  ___  \
//                    | |__| | \  \ |__|  |  |   \|  |  |  _\_/  |  |/  /|  |   \|  |  |  _\_/
//                    |   __/   | |      /|  |       |  | |_  \  |     | |  |    |  |  | |_  \
//                    |  |\  \_/  /  |\  \|  |  |\   |   \_/  |  |  |\  \|  |  |\   |   \_/  |
//                    |__| \_____/|__| \__\__|__| \__|\______/   |__| \__\__|__| \__|\______/
//----------------------------------------Script Last Update 2020-------------------------------------------
//==============================================Changelog===================================================
                                    // 1.0 *
                                    //        - Initial Release
                                    // 1.1
                                    //        - Added Host Event by GMAccess
                                    // 1.2
                                    //        - Remove all error from Latest rAthena
                                    //        - Maximize script
                                    //        - Fix some dialog of NPC
                                    //        - Added Mapflag for the Event Map 
//==========================================================================================================
prontera,155,185,6    script    Invasion NPC    459,{

set .gm,50;//GM Level to access the GM Menu. Default: 50

    // GM menu 
    //It allows GMs Level 50 or more to Start and Stop invasions.
    if (getgmlevel()>.gm) {
        if (.mobs_left) {
            mes "[Invasion]";
            mes "An invasion is in progress..";
            mes "Location: " + .Map$;
            mes "^FF0000"+.mobs_left+"^000000 Goblins left";
            mes " ";
            mes "Stop invasion?";
            if(select("No:Yes")==1) close;
            donpcevent "Invasion NPC::OnTimer1805000";
            mes "Invasion stopped";
            announce "The Invasion has been stopped by "+strcharinfo(0),bc_all;
            close;
        }
        mes "[Invasion]";
        mes "Please customize the Invasion event before starting it.";
        mes "Note - The Goblin Leader drops x5 of the prize.";
        Main:
        next;
        mes "[Invasion]";
            switch(select("Item [" + getitemname(.ItemID) + "]:Start Event")) {
        case 1:
            mes "Which item would you like the Goblin Leader to drop?";
            mes "Please input the item ID:";
            input .ItemID;
            goto Main;
        case 2:
            mes "Starting the event now...";
            close2;
            goto OnStart;
    }
    
    // If a player clicks the NPC, it displays:
    
    mes "[Invasion]";
    mes .mobs_left+" have invaded "+.Map$[.rand_map]+"!";
    close;
    
            /////////////////////////
            //The actual NPC Script//
            /////////////////////////
OnMinute50: // Change this to your liking
OnStart:
        set .mobs_left, 1;
        sleep 1000;
        set [email protected], rand(1,6);
        if ([email protected] == 6) set .Map$,"guild_vs3";
        if ([email protected] == 5) set .Map$,"guild_vs3";
        if ([email protected] == 4) set .Map$,"guild_vs3";
        if ([email protected] == 3) set .Map$,"guild_vs3";
        if ([email protected] == 2) set .Map$,"guild_vs3";
        if ([email protected] == 1) set .Map$,"guild_vs3";
        sleep 1000;
        announce "[ Rune-Midgard Guard ]: We have trouble here in the town " + .Map$ + "!", bc_all;
        sleep 5000;
        announce "[ Rune-Midgard Guard ]: Everyone, we need your help to get rid of these Goblins!", bc_all;
        monster .Map$,0,0,"Goblin",1258,10,"Invasion NPC::OnMyMobDead";
        monster .Map$,0,0,"Goblin",1299,1,"Invasion NPC::OnMyMobDead";
        set .mobs_left, 11;
        end;
    
    
OnTimer1805000:    // 30 minutes later, kills all the mobs.
                killmonster .Map$,"Invasion NPC::OnMyMobDead";
                set .mobs_left, 0;

OnStop://When the event is stopped by a GM, or all monsters dead.
            killmonster .Map$,"Invasion NPC::OnMyMobDead";
            killmonster .Map$,"Invasion NPC::OnSpecialMobDead";
            end;

OnMyMobDead: //When a Goblin is killed
            set .mobs_left, .mobs_left-1;
            if (.mobs_left==0) {
                announce "[ Rune-Midgard Guard ]: Everyone, thankyou for helping to get rid of these Goblins!", bc_all;
                getitem .ItemID,20; //Change the [5] to the amount you wish to hand out.
                donpcevent "Invasion NPC::OnStop";
                //announce "[Invasion NPC]: "+strcharinfo(0)+" has killed the last "+.mobname$+".",bc_all;
				announce "It seems that "+strcharinfo(0)+" has ended the Invasion!",bc_all;

            } else {
                //announce "["+.mobs_left+"/200] Goblins left.",bc_map;
                //announce "["+.mobs_left+"-"+200+"="+.mobs_left+"] Goblins left.",bc_map;
                //announce "[("+.mobs_left+")-(200)="+.mobs_left+"] Goblins left.",bc_map;
                
                announce "[ "+strcharinfo(0)+" ] has killed a Goblin. There are now "+.mobs_left+" Goblin left.",bc_map;
            }
            end;
            }
            end;
}

 

Hellow Sir can u explain what changes u did i checked whole script didn't see any changes expect announcement line

Can u explain a bit so i can solve it if i face this issue Thank you 😍

When i tested ur solution i got this error in CMD

image.png.435b14585b6bd6d0597a34fa3e9985b5.png

Edited by DEsMOn
Update
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...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.